Commits

windwiny  committed 848a706

add config file template

  • Participants
  • Parent commits 5a54085

Comments (0)

Files changed (4)

File config.template

+#  line begin '#' is comment
+#  line begin ';' is set; must set RSYNC and GUIDIFF program, and can add multi PATH
+
+; PATH = f:\grsync\bin
+; PATH = f:\Beyond Compare 2
+; RSYNC = rsync
+; GUIDIFF = bc2
+
+# demo on windows
+c:\*      ->  o:\*
+d:\dir1\* ->  p:\dir1\*
+e:\dir2   ->  q:\dir2
+
+# demo linux
+# /home/user1  /media/bak/home/user1
+

File config.txt

-e:\linux\ -> r:\linux
-e:\pypp\db2tool -> s:\pypp\db2tool
-e:\pypp\* -> s:\pypp
-e:\pypp\proj\* -> s:\pypp\proj
-
-e:\pypp\proj\crypt\*                   -> s:\pypp\proj\crypt\*              
-e:\pypp\proj\decompile\*               -> s:\pypp\proj\decompile\*          
-e:\pypp\proj\gui\*                     -> s:\pypp\proj\gui\*                
-e:\pypp\proj\ide\*                     -> s:\pypp\proj\ide\*                
-e:\pypp\proj\implementations\*         -> s:\pypp\proj\implementations\*    
-e:\pypp\proj\py-db\*                   -> s:\pypp\proj\py-db\*              
-e:\pypp\proj\scm\*                     -> s:\pypp\proj\scm\*                
-e:\pypp\proj\speedup\*                 -> s:\pypp\proj\speedup\*            
-e:\pypp\proj\web\*                     -> s:\pypp\proj\web\*                
-e:\pypp\proj\xml\*                     -> s:\pypp\proj\xml\*                

File mygrsyncdlg.py

         event.Skip()
         if not hasattr(self, '_rsyncdoc'):
             sp = subprocess.Popen('%s --help -v' % G._pg_RSYNC, shell=True,
-                                  stdout=subprocess.PIPE,
+                                  stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                   startupinfo=G.startupinfo)
             self._rsyncdoc = sp.stdout.read().decode(G.str_encode)
+            print sp.stderr.read()
             self._dlg = wx.Dialog(self, title=u"rsync --help", size=wx.Size(640,480),
                                   style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
             self._stc = wx.stc.StyledTextCtrl(self._dlg)

File mygrsyncframe.py

 
     @classmethod
     def initfromfile(cls, fn='config.txt'):
+        if fn == 'config.txt' and not os.path.exists(fn):
+            open(fn, 'wb').write(open('config.template', 'rb').read())
         cls.cs.execute('''delete from KV''')
         cls.cs.execute('''delete from EXCLUDE''')
         f = open(fn, 'r')