Commits

windwiny  committed 3981f46

change exclude dirs input format

  • Participants
  • Parent commits e116e07

Comments (0)

Files changed (2)

File mygrsyncdlg.py

 import os
 import subprocess
 import threading
+import shlex
 import time
 import wx
 import wx.stc
         expar = self.txtOther.GetValue().encode('gbk')
         if expar: cmds.append(expar)
         expar = self.txtExclude.GetValue().encode('gbk')
-        if expar: cmds.append(expar)
+        if expar: cmds.append(' '.join(['--exclude="%s"' % i for i in shlex.split(expar) if i]))
 
-        cmd = ' '.join(cmds)
-        del cmds[:]
+        cmds.append('  ')
 
         lu = self.txtSRC.GetValue().encode('gbk')
         if lu[-1] != '/': # FUXX
             ru = ru + '/'
         cmds.append('"%s"' % ru)
 
-        cmd += '    ' + ' '.join(cmds)
+        cmd = ' '.join(cmds)
         return cmd
 
     def OnChk_x(self, event):

File mygrsyncframe.py

         dlg.txtSRC.SetValue(lu)
         dlg.txtDST.SetValue(ru)
         excludes = G.getexcludesfroml(l)
-        excludes = ['--exclude="%s"' % i for i in excludes if i]
-        dlg.txtExclude.SetValue(' '.join(excludes))
+        excludes = ['"%s"' % i for i in excludes if i]
+        dlg.txtExclude.SetValue('  '.join(excludes))
         dlg.Show()
 
     
         mouse=wx.GetMousePosition()
         frame=self.GetPosition()
         self.delta=wx.Point(mouse.x-frame.x,mouse.y-frame.y)
-        self.ld= True
+        self.leftmd = True
 
     def OnPanel1LeftUp(self, event):
         event.Skip()
         if self.panel1.HasCapture():
             self.panel1.ReleaseMouse()
-        self.ld=False
+        self.leftmd = False
 
     def OnPanelMotion(self, event):
-        if event.Dragging() and self.ld:
+        if event.Dragging() and self.leftmd:
             mouse=wx.GetMousePosition()
             self.Move((mouse.x-self.delta.x,\
                        mouse.y-self.delta.y))