Updated regexs to support new and "improved" flow cell numbers!
[htsworkflow.git] / gaworkflow / runner.py
index 40aa9c86d16e80640b1062b5322d747eaaf584e0..a46504617f70bccee5c611aae33b76d2744db47d 100644 (file)
@@ -11,7 +11,8 @@ from benderjab import rpc
 from gaworkflow.pipeline.configure_run import *
 from gaworkflow.pipeline.monitors import startCmdLineStatusMonitor
 
-s_fc = re.compile('FC[0-9]+')
+#s_fc = re.compile('FC[0-9]+')
+s_fc = re.compile('_[0-9a-zA-Z]*$')
 
 
 def _get_flowcell_from_rundir(run_dir):
@@ -25,11 +26,9 @@ def _get_flowcell_from_rundir(run_dir):
         logging.error('RunDir 2 FlowCell error: %s' % (run_dir))
         return None
 
-    return dirname[mo.start():]
+    return dirname[mo.start()+1:]
     
 
-def _runner():
-
 
 class Runner(rpc.XmlRpcBot):
     """
@@ -46,7 +45,8 @@ class Runner(rpc.XmlRpcBot):
         self.conf_info_dict = {}
         
         self.register_function(self.sequencingFinished)
-        self.eventTasks.append(self.update)
+        #self.eventTasks.append(self.update)
+
     
     def read_config(self, section=None, configfile=None):
         super(Runner, self).read_config(section, configfile)
@@ -71,20 +71,25 @@ class Runner(rpc.XmlRpcBot):
             else:
                 reply = u"need runfolder name"
         else:
-            reply = u"I didn't understand '%s'" %(msg)            
+            reply = u"I didn't understand '%s'" %(msg)
+
+        logging.debug("reply: " + str(reply))
         return reply
+
         
     def start(self, daemonize):
         """
         Start application
         """
         super(Runner, self).start(daemonize)
+
         
     def stop(self):
         """
         shutdown application
         """
         super(Runner, self).stop()
+
             
     def sequencingFinished(self, run_dir):
         """
@@ -106,7 +111,6 @@ class Runner(rpc.XmlRpcBot):
         # Launch the job in it's own thread and turn.
         self.launchJob(run_dir, flowcell, ci)
         
-
         
     def pipelineFinished(self, run_dir):
         # need to strip off self.watch_dir from rundir I suspect.
@@ -127,7 +131,7 @@ class Runner(rpc.XmlRpcBot):
     def _runner(self, run_dir, flowcell, conf_info):
         # retrieve config step
         cfg_filepath = os.path.abspath('config32auto.txt')
-        status_retrieve_cfg = retrieve_config(ci,
+        status_retrieve_cfg = retrieve_config(conf_info,
                                           flowcell,
                                           cfg_filepath,
                                           self.genome_dir)
@@ -173,6 +177,7 @@ class Runner(rpc.XmlRpcBot):
         
 def main(args=None):
     bot = Runner()
+    bot.cfg['loglevel'] = 'DEBUG'
     return bot.main(args)
     
 if __name__ == "__main__":