Skip to content
Snippets Groups Projects
Commit e9cc1739 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

meal

parent c699d6e5
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,7 @@ class AbstractCFood(object):
raise NotImplementedError()
@classmethod
def cook(cls, crawled_file):
def cook(cls, crawled_file, **kwargs):
""" possibly checks for existing CFoods whether the match should be
added or whether a new CFood instance needs to be returned
......@@ -110,7 +110,7 @@ class AbstractCFood(object):
None: otherwise
"""
return cls()
return cls(crawled_file, **kwargs)
@classmethod
def match(cls, string):
......@@ -426,8 +426,8 @@ class CMeal(object):
suitable = True
for group in cls.matching_groups:
if (group not in match or
group not in cfood.match or
if (group not in match.groupdict() or
group not in cfood.match.groupdict()or
match.group(group) == cfood.match.group(group)):
suitable = False
......
......@@ -102,9 +102,9 @@ class Crawler(object):
Cfood.__class__.__name__,
crawled_file.path))
try:
cfoods.append(Cfood(crawled_file, access=self.access,
verbosity=self.verbosity,
guard=self.guard))
cfoods.append(Cfood.cook(crawled_file, access=self.access,
verbosity=self.verbosity,
guard=self.guard))
except Exception as e:
traceback.print_exc()
print(e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment