Skip to content

Commit 8e71f2d

Browse files
Python Black Formatierung umgesetzt
1 parent 4b2f2a3 commit 8e71f2d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

project/backend/RecipeSUCUK.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def findRecipes(ingriedents: list[Ingredient]) -> list[Recipe]:
1515

1616
if len(recipes) > 98:
1717
return recipes[:98]
18-
18+
1919
return recipes
2020

2121

project/backend/SearchRecipeNames.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,26 @@
22
from Ingredient import Ingredient
33
from Recipe import Recipe
44

5+
56
def getMatchingRecipeNames(searchTerm: str) -> list[Recipe]:
67
"""Gibt eine Liste von Rezepten zurück, die den Suchbegriff enthalten."""
78
searchTerm = searchTerm.lower()
89
matchingRecipes = []
910
for recipe in getAllRecipes():
1011
if searchTerm in recipe["name"].lower():
11-
matchingRecipes.append(Recipe(recipe["name"], __formatIngredients(recipe["id"]), recipe["description"]))
12+
matchingRecipes.append(
13+
Recipe(
14+
recipe["name"],
15+
__formatIngredients(recipe["id"]),
16+
recipe["description"],
17+
)
18+
)
1219
return matchingRecipes
1320

21+
1422
def __formatIngredients(id: int) -> list[Ingredient]:
1523
IngredientsRaw = getAllIngredientsForRecipe(id)
1624
Ingredients = []
1725
for IngredientRaw in IngredientsRaw:
1826
Ingredients.append(Ingredient(IngredientRaw["name"], IngredientRaw["amount"]))
19-
return Ingredients
27+
return Ingredients

0 commit comments

Comments
 (0)