[project @ rename runFinished to sequencingFinished]
authorDiane Trout <diane@caltech.edu>
Mon, 10 Dec 2007 21:16:47 +0000 (21:16 +0000)
committerDiane Trout <diane@caltech.edu>
Mon, 10 Dec 2007 21:16:47 +0000 (21:16 +0000)
I decided it would be a bit more clear to say that spool watcher is
detecing when the sequencing is finished. Since the whole run can now
include finishing running through the pipeline.

gaworkflow/copier.py
gaworkflow/spoolwatcher.py

index 268ff648ed9f11c4689e9b4979039bd8066a2d7c..a7f1c5c8239526b26626b02798cc106c0b3c816b 100644 (file)
@@ -136,7 +136,7 @@ class CopierBot(rpc.XmlRpcBot):
         self.notify_runner = None
         
         self.register_function(self.startCopy)
-        self.register_function(self.runFinished)
+        self.register_function(self.sequencingFinished)
         self.eventTasks.append(self.update)
         
     def read_config(self, section=None, configfile=None):
@@ -169,7 +169,7 @@ class CopierBot(rpc.XmlRpcBot):
         logging.info("copying:" + " ".join(started)+".")
         return started
         
-    def runFinished(self, runDir, *args):
+    def sequencingFinished(self, runDir, *args):
         """
         The run was finished, if we're done copying, pass the message on        
         """
@@ -181,12 +181,12 @@ class CopierBot(rpc.XmlRpcBot):
             if runDir in self.rsync.keys():
                 # still copying
                 self.pending.append(runDir)
-                logging.info("%s finished, but still copying" % (runDir))
+                logging.info("finished sequencing, but still copying" % (runDir))
                 return "PENDING"
             else:
                 # we're done
-                self.reportRunFinished(runDir)
-                logging.info("%s finished" % (runDir))
+                self.reportSequencingFinished(runDir)
+                logging.info("finished sequencing %s" % (runDir))
                 return "DONE"
         else:
             errmsg = "received bad runfolder name (%s)" % (runDir)
@@ -194,17 +194,17 @@ class CopierBot(rpc.XmlRpcBot):
             # maybe I should use a different error message
             raise RuntimeError(errmsg)
     
-    def reportRunFinished(self, runDir):
+    def reportSequencingFinished(self, runDir):
         """
-        Send the runFinished message to the interested parties
+        Send the sequencingFinished message to the interested parties
         """
         if self.notify_users is not None:
             for u in self.notify_users:
-                self.send(u, 'run %s finished' % (runDir))
+                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,), 'runFinished')
-        logging.info("forwarding runFinshed message for %s" % (runDir))
+                self.rpc_send(self.runner, (runDir,), 'sequencingFinished')
+        logging.info("forwarding sequencingFinshed message for %s" % (runDir))
         
     def update(self, *args):
         """
@@ -214,7 +214,7 @@ class CopierBot(rpc.XmlRpcBot):
         self.rsync.poll()
         for p in self.pending:
             if p not in self.rsync.keys():
-                self.reportRunFinished(p)
+                self.reportSequencingFinished(p)
                 self.pending.remove(p)
         
     def _parser(self, msg, who):
index 33a69b1db73908a90d255a3e83b87cdd9e0dd064..e3da123e8e381ebc21642ce047bc4dc11c1a2bdd 100644 (file)
@@ -23,9 +23,9 @@ class Handler(pyinotify.ProcessEvent):
         msg = "Create: %s" %  os.path.join(event.path, event.name)
         if event.name.lower() == "run.completed":
             try:
-                self.bot.runFinished(event.path)
+                self.bot.sequencingFinished(event.path)
             except IOError, e:
-                logging.error("Couldn't send runFinished")
+                logging.error("Couldn't send sequencingFinished")
         logging.debug(msg)
 
     def process_IN_DELETE(self, event):
@@ -151,7 +151,7 @@ class SpoolWatcher(rpc.XmlRpcBot):
             for r in self.notify_runner:
                 self.rpc_send(r, tuple(), 'startCopy')
         
-    def runFinished(self, run_dir):
+    def sequencingFinished(self, run_dir):
         # need to strip off self.watch_dir from rundir I suspect.
         logging.info("run.completed in " + str(run_dir))
         pattern = self.watch_dir
@@ -164,7 +164,7 @@ class SpoolWatcher(rpc.XmlRpcBot):
                 self.send(u, 'Sequencing run %s finished' % (stripped_run_dir))
         if self.notify_runner is not None:
             for r in self.notify_runner:
-                self.rpc_send(r, (stripped_run_dir,), 'runFinished')
+                self.rpc_send(r, (stripped_run_dir,), 'sequencingFinished')
         
 def main(args=None):
     bot = SpoolWatcher()