def check_dicomdir(self, event): '''check_dicomdir is the main function to call on a folder creation or modification, which both could signal new dicom directories ''' if self.is_finished(event.pathname): bot.log("2|FINISHED: %s" % (event.pathname)) if event.pathname.lower().startswith("test"): bot.log("Here would be call to import_dicomdir for %s" % (event.pathname)) else: # Here is the celery task to use import_dicomdir.apply_async( kwargs={"dicom_dir": event.pathname}) else: bot.log("2|NOTFINISHED: %s" % (event.pathname))
def process_IN_MOVED_TO(self, event): bot.log("1|MOVEDTO EVENT: %s" % (event.pathname)) self.check_dicomdir(event)
def process_IN_CLOSE_WRITE(self, event): bot.log("1|CLOSEWRITE EVENT: %s" % (event.pathname)) self.check_dicomdir(event)
def process_IN_MODIFY(self, event): bot.log("1|MODIFY EVENT: %s" % (event.pathname)) self.check_dicomdir(event)