:return: filename_list, subjectname_list
path_file = [(p, filename)
for p in self.path_to_search
for filename in sorted(os.listdir(p))]
matching_path_file = list(filter(self.__is_a_candidate, path_file))
filename_list = \
[os.path.join(p, filename) for p, filename in matching_path_file]
subjectname_list = [self.__extract_subject_id_from(filename)
for p, filename in matching_path_file]
if not filename_list or not subjectname_list:
raise IOError("no file matched based on this matcher: {}".format(
self.__dict__))
After Change
:return: filename_list, subjectname_list
path_file = [(p, filename)
for p in self.path_to_search
for filename in os.listdir(p)]
matching_path_file = list(filter(self.__is_a_candidate, path_file))
filename_list = \
[os.path.join(p, filename) for p, filename in matching_path_file]
subjectname_list = [self.__extract_subject_id_from(filename)
for p, filename in matching_path_file]
if not filename_list or not subjectname_list:
raise IOError("no file matched based on this matcher: {}".format(
self.__dict__))