fixed typos
This commit is contained in:
parent
fe8362b02c
commit
39e13a3454
|
|
@ -13,7 +13,7 @@ from argparse import ArgumentParser
|
|||
def parse_ingredient(ingredient_text):
|
||||
units = ['teaspoon', 'tablespoon', 'gram', 'once', 'jar', 'cup', 'pinch',
|
||||
'container', 'slice', 'package', 'pound', 'can', 'dash', 'spear',
|
||||
'bunch', 'quart', 'cube', 'envelope', 'squars', 'sprig']
|
||||
'bunch', 'quart', 'cube', 'envelope', 'square', 'sprig']
|
||||
number_regex = '((?:[\d\\./\\u00BC-\\u00BE\\u2150-\\u215E]*\s?(?:\(.+\))?)*)'
|
||||
ingredient_regex = '([a-zA-Z \'\-]+)'
|
||||
supplement_regex = ',?(.*)'
|
||||
|
|
@ -77,7 +77,7 @@ def parse_recipe(session, recipe, site):
|
|||
name_div = name_candidates[0]
|
||||
recipe.name = name_div.text
|
||||
|
||||
logging.info(f"Adding Recipe {recipe}")
|
||||
logging.info(f"Adding Recipe {recipe.name} from {recipe_url}")
|
||||
|
||||
session.add(recipe)
|
||||
session.flush()
|
||||
|
|
@ -156,7 +156,7 @@ with S.begin() as sess:
|
|||
except KeyboardInterrupt as e:
|
||||
savepoint.rollback()
|
||||
break
|
||||
except IntegrityError as e:
|
||||
except Exception as e:
|
||||
savepoint.rollback()
|
||||
logging.error(e)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in New Issue