def is_file_imported(self, input_file_path): """ Check if a file was imported and exists in *.resume.json :param input_file_path: path to input file """ if self.coverage_id in Resumer.__IMPORTED_DATA_DICT: for imported_file in Resumer.__IMPORTED_DATA_DICT[self.coverage_id]: if FileUtil.strip_root_url(input_file_path) == FileUtil.strip_root_url(imported_file): return True return False
def get_not_imported_files(self, files): """ Of the given files, return only those which are not present in the coverageId.resume.json file (i.e. already imported) :param List[File] files: input files list """ collected_files = [] tmp_dict = Resumer.__IMPORTED_DATA_DICT if self.coverage_id in tmp_dict: inported_files_list = tmp_dict[self.coverage_id] imported_files_set = { FileUtil.strip_root_url(f) for f in inported_files_list } for file in files: file_path = FileUtil.strip_root_url(file.get_filepath()) if file_path not in imported_files_set: collected_files.append(file) else: collected_files = files return collected_files