コード例 #1
0
ファイル: datareaper.py プロジェクト: francopestilli/nims
    def __init__(self, datetime_file):
        super(DataReaper, self).__init__()
        self.datetime_file = datetime_file
        self.last_update = nimsutil.get_reference_datetime(self.datetime_file)
        self.monitored_files = {}
        self.alive = True

        # stage any files left behind from a previous run
        for item in os.listdir(REAP_STAGE):
            if item.startswith(REAPER_ID):
                os.rename(os.path.join(REAP_STAGE, item), os.path.join(SORT_STAGE, item))
コード例 #2
0
ファイル: dicomreaper.py プロジェクト: francopestilli/nims
    def __init__(self, id_, scu, reap_stage, sort_stage, datetime_file, sleep_time, log):
        self.id_ = id_
        self.scu = scu
        self.reap_stage = reap_stage
        self.sort_stage = sort_stage
        self.datetime_file = datetime_file
        self.sleep_time = sleep_time
        self.log = log

        self.current_exam_datetime = nimsutil.get_reference_datetime(self.datetime_file)
        self.monitored_exams = collections.deque()
        self.alive = True

        # stage any files left behind from a previous run
        for item in os.listdir(self.reap_stage):
            if item.startswith(self.id_):
                os.rename(os.path.join(self.reap_stage, item), os.path.join(self.sort_stage, item))
コード例 #3
0
ファイル: filereaper.py プロジェクト: francopestilli/nims
    def __init__(self, id_, data_glob, reap_stage, sort_stage, datetime_file, sleep_time, log):
        super(FileReaper, self).__init__()
        self.id_ = id_
        self.data_glob = data_glob
        self.reap_stage = reap_stage
        self.sort_stage = sort_stage
        self.datetime_file = datetime_file
        self.sleep_time = sleep_time
        self.log = log

        self.current_file_timestamp = nimsutil.get_reference_datetime(self.datetime_file)
        self.monitored_files = {}
        self.alive = True

        # stage any files left behind from a previous run
        for item in os.listdir(self.reap_stage):
            if item.startswith(self.id_):
                os.rename(os.path.join(self.reap_stage, item), os.path.join(self.sort_stage, item))
コード例 #4
0
ファイル: dicomreaper.py プロジェクト: while321/nims
    def __init__(self, id_, scu, pat_id, discard_ids, reap_path, sort_path, datetime_file, sleep_time):
        self.id_ = id_
        self.scu = scu
        self.pat_id = pat_id
        self.discard_ids = discard_ids
        self.reap_stage = nimsutil.make_joined_path(reap_path)
        self.sort_stage = nimsutil.make_joined_path(sort_path)
        self.datetime_file = datetime_file
        self.sleep_time = sleep_time

        self.current_exam_datetime = nimsutil.get_reference_datetime(self.datetime_file)
        self.monitored_exams = collections.deque()
        self.alive = True

        # delete any files left behind from a previous run
        for item in os.listdir(self.reap_stage):
            if item.startswith(self.id_):
                shutil.rmtree(os.path.join(self.reap_stage, item))
        for item in os.listdir(self.sort_stage):
            if item.startswith('.' + self.id_):
                shutil.rmtree(os.path.join(self.sort_stage, item))
コード例 #5
0
ファイル: pfilereaper.py プロジェクト: bryancort/nims
    def __init__(self, id_, pat_id, discard_ids, data_path, reap_path, sort_path, datetime_file, sleep_time):
        super(PFileReaper, self).__init__()
        self.id_ = id_
        self.pat_id = pat_id
        self.discard_ids = discard_ids
        self.data_glob = os.path.join(data_path, 'P?????.7')
        self.reap_stage = nimsutil.make_joined_path(reap_path)
        self.sort_stage = nimsutil.make_joined_path(sort_path)
        self.datetime_file = datetime_file
        self.sleep_time = sleep_time

        self.current_file_timestamp = nimsutil.get_reference_datetime(self.datetime_file)
        self.monitored_files = {}
        self.alive = True

        # delete any files left behind from a previous run
        for item in os.listdir(self.reap_stage):
            if item.startswith(self.id_):
                shutil.rmtree(os.path.join(self.reap_stage, item))
        for item in os.listdir(self.sort_stage):
            if item.startswith('.' + self.id_):
                shutil.rmtree(os.path.join(self.sort_stage, item))
コード例 #6
0
    def __init__(self, id_, pat_id, discard_ids, data_path, reap_path,
                 sort_path, datetime_file, sleep_time):
        super(PFileReaper, self).__init__()
        self.id_ = id_
        self.pat_id = pat_id
        self.discard_ids = discard_ids
        self.data_glob = os.path.join(data_path, 'P?????.7')
        self.reap_stage = nimsutil.make_joined_path(reap_path)
        self.sort_stage = nimsutil.make_joined_path(sort_path)
        self.datetime_file = datetime_file
        self.sleep_time = sleep_time

        self.current_file_timestamp = nimsutil.get_reference_datetime(
            self.datetime_file)
        self.monitored_files = {}
        self.alive = True

        # delete any files left behind from a previous run
        for item in os.listdir(self.reap_stage):
            if item.startswith(self.id_):
                shutil.rmtree(os.path.join(self.reap_stage, item))
        for item in os.listdir(self.sort_stage):
            if item.startswith('.' + self.id_):
                shutil.rmtree(os.path.join(self.sort_stage, item))