diff --git a/src/caosadvancedtools/crawler.py b/src/caosadvancedtools/crawler.py index b0b7785b640933136eedcf9689c79451f7ea4d83..6f26aacd0eb36e8cc91c26ee91b6f80962369f58 100644 --- a/src/caosadvancedtools/crawler.py +++ b/src/caosadvancedtools/crawler.py @@ -78,7 +78,7 @@ class Crawler(object): errors_occured = False tbs = [] cfoods = [] - matches = {f: 0 for f in files} + matches = {f: [] for f in files} if self.verbosity >= INFO: print("-"*60) @@ -93,7 +93,7 @@ class Crawler(object): print("Matching {}...".format(crawled_file)) if Cfood.match(crawled_file) is not None: - matches[crawled_file] += 1 + matches[crawled_file].append(Cfood.__name__) if self.verbosity >= VERBOSE: print("{} matched\n{}.".format( @@ -139,17 +139,18 @@ class Crawler(object): Cfood.__class__.__name__, crawled_file)) cfood.attach(crawled_file) - matches[crawled_file] += 1 + matches[crawled_file].append(Cfood.__name__) if self.verbosity >= INFO: for crawled_file in files: - if matches[crawled_file] == 0: + if len(matches[crawled_file]) == 0: print("ATTENTION: No matching cfood!") print("Tried to match {}".format(crawled_file)) - if matches[crawled_file] > 1: + if len(matches[crawled_file]) > 1: print("Attention: More than one matching cfood!") - print("Tried to match {}".format(crawled_file)) + print("Tried to match {}:".format(crawled_file)) + print("\t\t" + ", ".join(matches[crawled_file])) return cfoods, matches, tbs, errors_occured