mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-12 05:15:18 -05:00
docs: fix typos (#1665)
* docs: fix typos * typos: fix typos found by `codespell` across the codebase * docs: fix `macOS` spelling * docs: fix `authentification` terminology "Authentification" is not a thing. * docs: fix `localhost` typo in example link * typos: fix in-code typos These are potentially higher risk, but no other mentions of these typos show up in the codebase.
This commit is contained in:
@@ -64,7 +64,7 @@ logging.basicConfig(
|
||||
|
||||
|
||||
def logger_init() -> logging.Logger:
|
||||
"""Returns the Root Loggin Object for Mealie"""
|
||||
"""Returns the Root Logging Object for Mealie"""
|
||||
return logging.getLogger("mealie")
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class AppDirectories:
|
||||
for dir in required_dirs:
|
||||
dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Boostrap Templates
|
||||
# Bootstrap Templates
|
||||
markdown_template = self.TEMPLATE_DIR.joinpath("recipes.md")
|
||||
|
||||
if not markdown_template.exists():
|
||||
|
||||
@@ -15,7 +15,7 @@ class Base:
|
||||
|
||||
class BaseMixins:
|
||||
"""
|
||||
`self.update` method which directly passing arugments to the `__init__`
|
||||
`self.update` method which directly passing arguments to the `__init__`
|
||||
`cls.get_ref` method which will return the object from the database or none. Useful for many-to-many relationships.
|
||||
"""
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ from typing import Any
|
||||
|
||||
def get_valid_call(func: Callable, args_dict) -> dict:
|
||||
"""
|
||||
Returns a dictionary of valid arguemnts for the supplied function. if kwargs are accepted,
|
||||
Returns a dictionary of valid arguments for the supplied function. if kwargs are accepted,
|
||||
the original dictionary will be returned.
|
||||
"""
|
||||
|
||||
def get_valid_args(func: Callable) -> list[str]:
|
||||
"""
|
||||
Returns a tuple of valid arguemnts for the supplied function.
|
||||
Returns a tuple of valid arguments for the supplied function.
|
||||
"""
|
||||
return inspect.getfullargspec(func).args
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ def sizeof_fmt(file_path: Path, decimal_places=2):
|
||||
@dataclass
|
||||
class MinifierOptions:
|
||||
original: bool = True
|
||||
minature: bool = True
|
||||
miniature: bool = True
|
||||
tiny: bool = True
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class PillowMinifier(ABCMinifier):
|
||||
PillowMinifier.to_webp(image_file, org_dest, quality=70)
|
||||
success = True
|
||||
|
||||
if self._opts.minature:
|
||||
if self._opts.miniature:
|
||||
if not force and min_dest.exists():
|
||||
self._logger.info(f"{image_file.name} already minified")
|
||||
else:
|
||||
|
||||
@@ -16,7 +16,7 @@ U = TypeVar("U", bound=BaseModel)
|
||||
class HttpRepo(Generic[C, R, U]):
|
||||
"""
|
||||
The HttpRepo[C, R, U] class is a mixin class that provides a common set of methods for CRUD operations.
|
||||
This class is inteded to be used in a composition pattern where a class has a mixin property. For example:
|
||||
This class is intended to be used in a composition pattern where a class has a mixin property. For example:
|
||||
|
||||
```
|
||||
class MyClass:
|
||||
|
||||
@@ -43,7 +43,7 @@ def clean_recipe_folders(root_dir: Path, dry_run: bool) -> int:
|
||||
|
||||
for recipe_dir in root_dir.iterdir():
|
||||
if recipe_dir.is_dir():
|
||||
# Attemp to convert the folder name to a UUID
|
||||
# Attempt to convert the folder name to a UUID
|
||||
try:
|
||||
uuid.UUID(recipe_dir.name)
|
||||
continue
|
||||
|
||||
@@ -46,14 +46,14 @@ class GroupMealplanController(BaseUserController):
|
||||
@router.post("/random", response_model=ReadPlanEntry)
|
||||
def create_random_meal(self, data: CreateRandomEntry):
|
||||
"""
|
||||
create_random_meal is a route that provides the randomized funcitonality for mealplaners.
|
||||
create_random_meal is a route that provides the randomized functionality for mealplaners.
|
||||
It operates by following the rules setout in the Groups mealplan settings. If not settings
|
||||
are set, it will default return any random meal.
|
||||
|
||||
Refer to the mealplan settings routes for more information on how rules can be applied
|
||||
to the random meal selector.
|
||||
"""
|
||||
# Get relavent group rules
|
||||
# Get relevant group rules
|
||||
rules = self.repos.group_meal_plan_rules.by_group(self.group_id).get_rules(
|
||||
PlanRulesDay.from_date(data.date), data.entry_type.value
|
||||
)
|
||||
|
||||
@@ -83,7 +83,7 @@ class RecipeIngredient(MealieModel):
|
||||
@classmethod
|
||||
def validate_quantity(cls, value, values) -> NoneFloat:
|
||||
"""
|
||||
Sometimes the frontend UI will provide an emptry string as a "null" value because of the default
|
||||
Sometimes the frontend UI will provide an empty string as a "null" value because of the default
|
||||
bindings in Vue. This validator will ensure that the quantity is set to None if the value is an
|
||||
empty string.
|
||||
"""
|
||||
|
||||
@@ -13,7 +13,7 @@ class ErrorResponse(BaseModel):
|
||||
@classmethod
|
||||
def respond(cls, message: str, exception: Optional[str] = None) -> dict:
|
||||
"""
|
||||
This method is an helper to create an obect and convert to a dictionary
|
||||
This method is an helper to create an object and convert to a dictionary
|
||||
in the same call, for use while providing details to a HTTPException
|
||||
"""
|
||||
return cls(message=message, exception=exception).dict()
|
||||
@@ -26,7 +26,7 @@ class SuccessResponse(BaseModel):
|
||||
@classmethod
|
||||
def respond(cls, message: str) -> dict:
|
||||
"""
|
||||
This method is an helper to create an obect and convert to a dictionary
|
||||
This method is an helper to create an object and convert to a dictionary
|
||||
in the same call, for use while providing details to a HTTPException
|
||||
"""
|
||||
return cls(message=message).dict()
|
||||
@@ -38,7 +38,7 @@ class FileTokenResponse(MealieModel):
|
||||
@classmethod
|
||||
def respond(cls, token: str) -> dict:
|
||||
"""
|
||||
This method is an helper to create an obect and convert to a dictionary
|
||||
This method is an helper to create an object and convert to a dictionary
|
||||
in the same call, for use while providing details to a HTTPException
|
||||
"""
|
||||
return cls(file_token=token).dict()
|
||||
|
||||
@@ -15,7 +15,7 @@ class MealPlanService(BaseService):
|
||||
def get_random_recipe(self, categories: list[RecipeCategory] = None) -> Recipe:
|
||||
"""get_random_recipe returns a single recipe matching a specific criteria of
|
||||
categories. if no categories are provided, a single recipe is returned from the
|
||||
entire recipe databas.
|
||||
entire recipe database.
|
||||
|
||||
Note that the recipe must contain ALL categories in the list provided.
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class ShoppingListService:
|
||||
"""
|
||||
itterates through the shopping list provided and returns
|
||||
a consolidated list where all items that are matched against multiple values are
|
||||
de-duplicated and only the first item is kept where the quantity is updated accoridngly.
|
||||
de-duplicated and only the first item is kept where the quantity is updated accordingly.
|
||||
"""
|
||||
|
||||
consolidated_list: list[ShoppingListItemOut] = []
|
||||
|
||||
@@ -19,5 +19,5 @@ def move_parens_to_end(ing_str) -> str:
|
||||
|
||||
|
||||
def check_char(char, *eql) -> bool:
|
||||
"""Helper method to check if a charaters matches any of the additional provided arguments"""
|
||||
"""Helper method to check if a characters matches any of the additional provided arguments"""
|
||||
return any(char == eql_char for eql_char in eql)
|
||||
|
||||
@@ -11,7 +11,7 @@ replace_abbreviations = {
|
||||
"pint": " pint ",
|
||||
"qt": " quart ",
|
||||
"tbsp": " tablespoon ",
|
||||
"tbs": " tablespoon ", # Order Matters!, 'tsb' must come after 'tbsp' incase of duplicate matches
|
||||
"tbs": " tablespoon ", # Order Matters!, 'tsb' must come after 'tbsp' in case of duplicate matches
|
||||
"tsp": " teaspoon ",
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ def wrap_or_clause(string: str):
|
||||
'1 tsp. Diamond Crystal or ½ tsp. Morton kosher salt, plus more' -> '1 teaspoon diamond crystal (or 1/2 teaspoon morton kosher salt), plus more'
|
||||
|
||||
"""
|
||||
# TODO: Needs more adequite testing to be sure this doens't have side effects.
|
||||
# TODO: Needs more adequite testing to be sure this doesn't have side effects.
|
||||
split_by_or = string.split(" or ")
|
||||
|
||||
split_by_comma = split_by_or[1].split(",")
|
||||
|
||||
@@ -78,7 +78,7 @@ class NLPParser(ABCIngredientParser):
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to parse ingredient: {crf_model}: {e}")
|
||||
# TODO: Capture some sort of state for the user to see that an exception occured
|
||||
# TODO: Capture some sort of state for the user to see that an exception occurred
|
||||
ingredient = RecipeIngredient(
|
||||
title="",
|
||||
note=crf_model.input,
|
||||
|
||||
@@ -83,8 +83,8 @@ class RecipeService(BaseService):
|
||||
def _recipe_creation_factory(user: PrivateUser, name: str, additional_attrs: dict = None) -> Recipe:
|
||||
"""
|
||||
The main creation point for recipes. The factor method returns an instance of the
|
||||
Recipe Schema class with the appropriate defaults set. Recipes shoudld not be created
|
||||
else-where to avoid conflicts.
|
||||
Recipe Schema class with the appropriate defaults set. Recipes should not be created
|
||||
elsewhere to avoid conflicts.
|
||||
"""
|
||||
additional_attrs = additional_attrs or {}
|
||||
additional_attrs["name"] = name
|
||||
|
||||
@@ -7,7 +7,7 @@ logger = root_logger.get_logger()
|
||||
|
||||
class SchedulerRegistry:
|
||||
"""
|
||||
A container class for registring and removing callbacks for the scheduler.
|
||||
A container class for registering and removing callbacks for the scheduler.
|
||||
"""
|
||||
|
||||
_daily: list[Callable] = []
|
||||
|
||||
@@ -17,6 +17,6 @@ Tasks Package
|
||||
|
||||
Common recurring tasks for the server to perform. Tasks here are registered to the SchedulerRegistry class
|
||||
in the app.py file as a post-startup task. This is done to ensure that the tasks are run after the server has
|
||||
started up and the Scheduler object is only avaiable to a single worker.
|
||||
started up and the Scheduler object is only available to a single worker.
|
||||
|
||||
"""
|
||||
|
||||
@@ -42,7 +42,7 @@ def safe_scrape_html(url: str) -> str:
|
||||
raise ForceTimeoutException()
|
||||
|
||||
# =====================================
|
||||
# Coppied from requests text property
|
||||
# Copied from requests text property
|
||||
|
||||
# Try charset from content-type
|
||||
content = None
|
||||
|
||||
@@ -24,7 +24,7 @@ class BackgroundExecutor:
|
||||
pass
|
||||
|
||||
def dispatch(self, task_name: ServerTaskNames, func: Callable, *args: Any, **kwargs: Any) -> ServerTask:
|
||||
"""The dispatch function is a wrapper around the BackgroundTasks class in Starlett. It dirctly calls
|
||||
"""The dispatch function is a wrapper around the BackgroundTasks class in Starlett. It directly calls
|
||||
the add_task function and your task will be run in the background. This function all passes the id required
|
||||
to check on the server tasks in the database and provide updates.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class PasswordResetService(BaseService):
|
||||
|
||||
if user is None:
|
||||
self.logger.error(f"failed to create password reset for {email=}: user doesn't exists")
|
||||
# Do not raise exception here as we don't want to confirm to the client that the Email doens't exists
|
||||
# Do not raise exception here as we don't want to confirm to the client that the Email doesn't exists
|
||||
return None
|
||||
|
||||
# Create Reset Token
|
||||
|
||||
Reference in New Issue
Block a user