forgot to rename the caller and called when refactoring the dirlist parsing
[htsworkflow.git] / gaworkflow / copier.py
index a7f1c5c8239526b26626b02798cc106c0b3c816b..b78ad6abac0bafce83a71449761796bbb0844f4d 100644 (file)
@@ -32,13 +32,19 @@ class rsync(object):
 
   def list(self):
     """Get a directory listing"""
-    dirs_to_copy = []
     args = copy.copy(self.cmd)
     args.append(self.source_base)
 
     logging.debug("Rsync cmd:" + " ".join(args))
     short_process = subprocess.Popen(args, stdout=subprocess.PIPE)
-    direntries = [ x.split() for x in short_process.stdout ]
+    return self.list_filter(short_process.stdout)
+
+  def list_filter(self, lines):
+    """
+    parse rsync directory listing
+    """
+    dirs_to_copy = []
+    direntries = [ x[0:42].split() + [x[43:]] for x in lines ]
     for permissions, size, filedate, filetime, filename in direntries:
       if permissions[0] == 'd':
         # hey its a directory, the first step to being something we want to 
@@ -203,7 +209,7 @@ class CopierBot(rpc.XmlRpcBot):
                 self.send(u, 'Sequencing run %s finished' % (runDir))
         if self.notify_runner is not None:
             for r in self.notify_runner:
-                self.rpc_send(self.runner, (runDir,), 'sequencingFinished')
+                self.rpc_send(r, (runDir,), 'sequencingFinished')
         logging.info("forwarding sequencingFinshed message for %s" % (runDir))
         
     def update(self, *args):
@@ -233,7 +239,7 @@ class CopierBot(rpc.XmlRpcBot):
               msg.append(u"  " + d)
             reply = os.linesep.join(msg)
         else:
-            reply = u"I didn't understand '%s'"+os.linesep+help % (unicode(msg))
+            reply = u"I didn't understand '%s'" % (unicode(msg))
         return reply
 
 def main(args=None):