Commits

windwiny committed 78c0cbc

config split

  • Participants
  • Parent commits 2c00142

Comments (0)

Files changed (2)

+
+#import os
+#os.popen('wmic volume  get name , label').read()
+import socket
+
+hostname = socket.gethostbyaddr('localhost')[0]
+
+if 'TONN' in hostname.upper():
+    ss = ''
+else:
+    ss = 'cp do es ft gu yq'
+
+dst = {}
+for i in ss.upper().split():
+    if len(i) != 2: continue
+    i1, i2 = i[0], i[1]
+    dst[i1] = i2
+    dst[i2] = i1
+
+fastcopy = r'e:\ux\fastcopy\fastcopy.exe'
+
+editor = r'e:\programs1\editplus3\editplus.exe'
+filelog = r'e:\ux\FastCopy\Log\filelog.log'
+

File mygrsyncframe2.py

 import wx
 import wx.stc
 
+import config
+
 class G:
     str_encode = locale.getdefaultlocale()[1]
     _pg_RSYNC = 'rsync'
             self._logdlg.Hide()
         else:
             self._logdlg.Show()
-        subprocess.Popen(r'e:\programs1\editplus3\editplus e:\ux\FastCopy\Log\filelog.log')
+        subprocess.Popen('"%s" "%s"' % (config.editor, config.filelog))
 
     def OnBtnExitButton(self, event):
         event.Skip()
         self.Close()
 
     def OnBtnGetDirsButton(self, event):
-        r = {
-            'C': 'P',
-            'D': 'O',
-            'E': 'S',
-            'F': 'T',
-            'G': 'U',
-            'Y': 'Q',
-        }
         print 'begin'
         
         jobs = {}
             for f in fs:
                 dst = os.path.dirname(f)
                 if dst[-1] != '\\': dst += '\\'
-                if dst[0].upper() in r:
-                    dst = r[dst[0].upper()] + dst[1:]
+                if dst[0].upper() in config.dst:
+                    dst = config.dst[dst[0].upper()] + dst[1:]
                 else:
                     winsound.Beep(3000, 160)
                 if dst in jobs:
             print '--------\n%s<----\n%s\n' % (dst, '\n'.join(srcs))
             srcs = ' '.join('"%s"' % f for f in srcs)
             cmds = (
-                r'''e:\ux\fastcopy\fastcopy.exe'''
-                r''' /cmd=diff /auto_close /open_window'''
-                r''' /no_exec /error_stop /bufsize=32'''
-                r''' /log /filelog=filelog.log /utf8'''
-                r''' /disk_mode=auto /speed=autoslow'''
-                r'''  %s /to="%s" ''' % (srcs, dst) )
+                '''"%s"'''
+                ''' /cmd=diff /auto_close /open_window'''
+                ''' /no_exec /error_stop /bufsize=32'''
+                ''' /log /filelog=filelog.log /utf8'''
+                ''' /disk_mode=auto /speed=autoslow'''
+                '''  %s /to="%s" ''' % (config.fastcopy, srcs, dst) )
             print cmds
             subprocess.Popen(cmds)
         print 'end'