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): ...@@ -94,7 +94,7 @@ class AbstractCFood(object):
raise NotImplementedError() raise NotImplementedError()
@classmethod @classmethod
def cook(cls, crawled_file): def cook(cls, crawled_file, **kwargs):
""" possibly checks for existing CFoods whether the match should be """ possibly checks for existing CFoods whether the match should be
added or whether a new CFood instance needs to be returned added or whether a new CFood instance needs to be returned
...@@ -110,7 +110,7 @@ class AbstractCFood(object): ...@@ -110,7 +110,7 @@ class AbstractCFood(object):
None: otherwise None: otherwise
""" """
return cls() return cls(crawled_file, **kwargs)
@classmethod @classmethod
def match(cls, string): def match(cls, string):
...@@ -426,8 +426,8 @@ class CMeal(object): ...@@ -426,8 +426,8 @@ class CMeal(object):
suitable = True suitable = True
for group in cls.matching_groups: for group in cls.matching_groups:
if (group not in match or if (group not in match.groupdict() or
group not in cfood.match or group not in cfood.match.groupdict()or
match.group(group) == cfood.match.group(group)): match.group(group) == cfood.match.group(group)):
suitable = False suitable = False
......
...@@ -102,9 +102,9 @@ class Crawler(object): ...@@ -102,9 +102,9 @@ class Crawler(object):
Cfood.__class__.__name__, Cfood.__class__.__name__,
crawled_file.path)) crawled_file.path))
try: try:
cfoods.append(Cfood(crawled_file, access=self.access, cfoods.append(Cfood.cook(crawled_file, access=self.access,
verbosity=self.verbosity, verbosity=self.verbosity,
guard=self.guard)) guard=self.guard))
except Exception as e: except Exception as e:
traceback.print_exc() traceback.print_exc()
print(e) 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