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.
self.notify_runner = None
self.register_function(self.startCopy)
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):
self.eventTasks.append(self.update)
def read_config(self, section=None, configfile=None):
logging.info("copying:" + " ".join(started)+".")
return started
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
"""
"""
The run was finished, if we're done copying, pass the message on
"""
if runDir in self.rsync.keys():
# still copying
self.pending.append(runDir)
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
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)
return "DONE"
else:
errmsg = "received bad runfolder name (%s)" % (runDir)
# maybe I should use a different error message
raise RuntimeError(errmsg)
# 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:
"""
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:
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):
"""
def update(self, *args):
"""
self.rsync.poll()
for p in self.pending:
if p not in self.rsync.keys():
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):
self.pending.remove(p)
def _parser(self, msg, who):
msg = "Create: %s" % os.path.join(event.path, event.name)
if event.name.lower() == "run.completed":
try:
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)
- logging.error("Couldn't send runFinished")
+ logging.error("Couldn't send sequencingFinished")
logging.debug(msg)
def process_IN_DELETE(self, event):
logging.debug(msg)
def process_IN_DELETE(self, event):
for r in self.notify_runner:
self.rpc_send(r, tuple(), 'startCopy')
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
# need to strip off self.watch_dir from rundir I suspect.
logging.info("run.completed in " + str(run_dir))
pattern = self.watch_dir
self.send(u, 'Sequencing run %s finished' % (stripped_run_dir))
if self.notify_runner is not None:
for r in self.notify_runner:
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()
def main(args=None):
bot = SpoolWatcher()