Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingredient grouping & equipment support for saltpepperskillet #1334

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jknndy
Copy link
Collaborator

@jknndy jknndy commented Oct 23, 2024

No description provided.

@jknndy jknndy marked this pull request as ready for review October 23, 2024 23:31
Comment on lines +13 to +19
def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-ingredient-group h4",
".wprm-recipe-ingredient",
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we should probably consider making WPRM ingredient-group support available as a Mixin (or perhaps a few mixins with different variants based on the WordPress plugin(s) in use) -- these defaults seem to appear fairly often.

Comment on lines +25 to +32
if equipment_container:
return [
item.get_text(strip=True)
for item in equipment_container.find_all(
"div", class_="wprm-recipe-equipment-name"
)
]
return None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if equipment_container:
return [
item.get_text(strip=True)
for item in equipment_container.find_all(
"div", class_="wprm-recipe-equipment-name"
)
]
return None
if not equipment_container:
return None
return [
item.get_text(strip=True)
for item in equipment_container.find_all(
"div", class_="wprm-recipe-equipment-name"
)
]

...and maybe get_equipment? :)

Copy link
Collaborator

@jayaddison jayaddison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - thank you @jknndy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants