mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-24 01:12:54 -04: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:
parent
33dad80eff
commit
2e6b877ba9
@ -23,8 +23,8 @@ def is_postgres():
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
|
||||
# SQLite doesn't require migration as types are not inforced.
|
||||
# Postgres Specifc Migration
|
||||
# SQLite doesn't require migration as types are not enforced.
|
||||
# Postgres Specific Migration
|
||||
if is_postgres():
|
||||
op.alter_column(
|
||||
"recipes_ingredients",
|
||||
@ -38,8 +38,8 @@ def upgrade():
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
|
||||
# SQLite doesn't require migration as types are not inforced.
|
||||
# Postgres Specifc Migration
|
||||
# SQLite doesn't require migration as types are not enforced.
|
||||
# Postgres Specific Migration
|
||||
if is_postgres():
|
||||
op.alter_column(
|
||||
"recipes_ingredients",
|
||||
|
@ -39,7 +39,7 @@ NAMES = {
|
||||
"nl-NL": "Nederlands (Dutch)",
|
||||
"pl-PL": "Polski (Polish)",
|
||||
"pt-BR": "Português do Brasil (Brazilian Portuguese)",
|
||||
"pt-PT": "Português (Portugese)",
|
||||
"pt-PT": "Português (Portuguese)",
|
||||
"ro-RO": "Română (Romanian)",
|
||||
"ru-RU": "Pусский (Russian)",
|
||||
"sr-SP": "српски (Serbian)",
|
||||
|
@ -11,7 +11,7 @@ from mealie.app import app
|
||||
"""
|
||||
This code is used for generating route objects for each route in the OpenAPI Specification.
|
||||
Currently, they are NOT automatically injected into the test suite. As such, you'll need to copy
|
||||
the relavent contents of the generated file into the test suite where applicable. I am slowly
|
||||
the relevant contents of the generated file into the test suite where applicable. I am slowly
|
||||
migrating the test suite to use this new generated file and this process will be "automated" in the
|
||||
future.
|
||||
"""
|
||||
|
@ -67,6 +67,6 @@ This is, what I think, is a big release! Tons of new features and some great qua
|
||||
### Breaking Changes
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
- API endpoints have been refactored to adhear to a more consistent standard. This is a WIP and more changes are likely to occur.
|
||||
- API endpoints have been refactored to adhere to a more consistent standard. This is a WIP and more changes are likely to occur.
|
||||
- Officially Dropped MongoDB Support
|
||||
- Database Breaks! We have not yet implemented a database migration service. As such, upgrades cannot be done by simply pulling the image. You must first export your recipes, update your deployment, and then import your recipes. This pattern is likely to be how upgrades take place prior to v1.0. After v1.0 migrations will be done automatically.
|
||||
|
@ -73,7 +73,7 @@
|
||||
- See what's for dinner
|
||||
- Manage Long Live API Tokens (New)
|
||||
- New Admin Dashboard! 🎉
|
||||
- Now you can get some insight on your application with application statics and events.
|
||||
- Now you can get some insight on your application with application statistics and events.
|
||||
- See uncategorized/untagged recipes and organize them!
|
||||
- Backup/Restore right from your dashboard
|
||||
- See server side events. Now you can know who deleted your favorite recipe!
|
||||
|
@ -73,7 +73,7 @@
|
||||
|
||||
- Site Settings has been completely revamped. All site-wide settings at defined on the server as ENV variables. The site settings page now only shows you the non-secret values for reference. It also has some helpers to let you know if something isn't configured correctly.
|
||||
- Server Side Bare URL will let you know if the BASE_URL env variable has been set
|
||||
- Secure Site let's you know if you're serving via HTTPS or accessing by localhost. accessing without a secure site will render some of the features unusable.
|
||||
- Secure Site let's you know if you're serving via HTTPS or accessing by localhost. Accessing without a secure site will render some of the features unusable.
|
||||
- Email Configuration Status will let you know if all the email settings have been provided and offer a way to send test emails.
|
||||
|
||||
#### 👨👩👧👦 Users and Groups
|
||||
|
@ -36,7 +36,7 @@ Checkout the makefile for all of the available commands.
|
||||
|
||||
Once the prerequisites are installed you can cd into the project base directory and run `make setup` to install the python and node dependencies.
|
||||
|
||||
=== "Linux / MacOs"
|
||||
=== "Linux / macOS"
|
||||
|
||||
```bash
|
||||
# Naviate To The Root Directory
|
||||
@ -66,7 +66,7 @@ Before you start the server you MUST copy the `template.env` and `frontend/templ
|
||||
|
||||
Once that is complete you're ready to start the servers. You'll need two shells open, One for the server and one for the frontend.
|
||||
|
||||
=== "Linux / MacOs"
|
||||
=== "Linux / macOS"
|
||||
|
||||
```bash
|
||||
# Terminal #1
|
||||
|
@ -4,7 +4,7 @@ Mealie uses Conditional Random Fields (CRFs) for parsing and processing ingredie
|
||||
|
||||
## Improving The CRF Parser
|
||||
|
||||
To improve results with the model, you'll likely need to focus on improving the tokenization and parsing of the original string to aid the model in determine what the ingredient is. Datascience is not my forte, but I have done some tokenization to improve the model. You can find that code under `/mealie/services/parser_services/crfpp` along with some other utility functions to aid in the tokenization and processing of ingredient strings.
|
||||
To improve results with the model, you'll likely need to focus on improving the tokenization and parsing of the original string to aid the model in determine what the ingredient is. Data science is not my forte, but I have done some tokenization to improve the model. You can find that code under `/mealie/services/parser_services/crfpp` along with some other utility functions to aid in the tokenization and processing of ingredient strings.
|
||||
|
||||
The best way to test on improving the parser is to register additional test cases in `/mealie/tests/unit_tests/test_crfpp_parser.py` and run the test after making changes to the tokenizer. Note that the test cases DO NOT run in the CI environment, therefore you will need to have CRF++ installed on your machine. If you're using a Mac the easiest way to do this is through brew.
|
||||
|
||||
|
@ -8,7 +8,7 @@ Recipes can be imported in bulk from a file containing a list of URLs. This can
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
function authentification () {
|
||||
function authentication () {
|
||||
auth=$(curl -X 'POST' \
|
||||
"$3/api/auth/token" \
|
||||
-H 'accept: application/json' \
|
||||
@ -38,7 +38,7 @@ password="MyPassword"
|
||||
mealie_url=http://localhost:9000
|
||||
|
||||
|
||||
token=$(authentification $mail $password $mealie_url)
|
||||
token=$(authentication $mail $password $mealie_url)
|
||||
import_from_file $input $token $mealie_url
|
||||
|
||||
```
|
||||
@ -51,7 +51,7 @@ See <a href="https://github.com/Jleagle/mealie-importer" target="_blank">Jleagle
|
||||
import requests
|
||||
import re
|
||||
|
||||
def authentification(mail, password, mealie_url):
|
||||
def authentication(mail, password, mealie_url):
|
||||
headers = {
|
||||
'accept': 'application/json',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
@ -90,7 +90,7 @@ password="MyPassword"
|
||||
mealie_url="http://localhost:9000"
|
||||
|
||||
|
||||
token = authentification(mail, password, mealie_url)
|
||||
token = authentication(mail, password, mealie_url)
|
||||
import_from_file(input_file, token, mealie_url)
|
||||
```
|
||||
|
||||
|
@ -52,7 +52,7 @@ Each of the above organizers can be filtered in searches, and have their own pag
|
||||
|
||||
#### Cookbooks
|
||||
|
||||
Mealie also has the concept of cookbooks. These can be created inside of a group and can use a cross section of Categories, Tags, and Tools to filter recipes and view them in one specific page. Cookbooks are a great way to keep a supset of recipes easily accessible to you. You can think of them as a saved search results page. While most examples are simple, you can use as many organizers to filter a cookbook as you'd like.
|
||||
Mealie also has the concept of cookbooks. These can be created inside of a group and can use a cross section of Categories, Tags, and Tools to filter recipes and view them in one specific page. Cookbooks are a great way to keep a subset of recipes easily accessible to you. You can think of them as a saved search results page. While most examples are simple, you can use as many organizers to filter a cookbook as you'd like.
|
||||
|
||||
#### Examples:
|
||||
|
||||
@ -113,7 +113,7 @@ Managing a robust collection of recipes inevitable requires a lot of data. Meali
|
||||
|
||||
### Site Settings
|
||||
|
||||
The site settings page contains general information about your installtion like the application version, some configuration details, and some utilities to help you confirm your installation is working as expected. For example, you can use the Email Configuration section to validate that your email credentials are setup correctly and that the email service is working as expected. Additionally, there is a docker-volume utility that will confirm your volumes are configured and shared correctly between the front and backend of the application.
|
||||
The site settings page contains general information about your installation like the application version, some configuration details, and some utilities to help you confirm your installation is working as expected. For example, you can use the Email Configuration section to validate that your email credentials are setup correctly and that the email service is working as expected. Additionally, there is a docker-volume utility that will confirm your volumes are configured and shared correctly between the front and backend of the application.
|
||||
|
||||
[Demo](https://demo.mealie.io/admin/site-settings){ .md-button .md-button--primary }
|
||||
|
||||
|
@ -63,7 +63,7 @@ After you've configured your database, and updated the `docker-compose.yaml` fil
|
||||
$ docker-compose up -d
|
||||
```
|
||||
|
||||
You should see the containers start up without error. You should now be able to access the Mealie frontend at [http://localhost:9925](http://locahost:9925).
|
||||
You should see the containers start up without error. You should now be able to access the Mealie frontend at [http://localhost:9925](http://localhost:9925).
|
||||
|
||||
!!! tip "Default Credentials"
|
||||
|
||||
@ -102,8 +102,8 @@ While the docker-compose file should work without modification, some users want
|
||||
|
||||

|
||||
|
||||
In the diagram above there's a few crutial things to note.
|
||||
In the diagram above there's a few crucial things to note.
|
||||
|
||||
1. Port 9925 is the host port, this can be anything you want. The important part is that it's mapped to the mealie-frontend container at port 3000.
|
||||
2. The mealie-frontend container communicated with the mealie-api container through the INTERNAL docker network. This requires that the two containers are on the same network and that the network supports name resolution (anything but the default bridge network). The resolution URL can be specified in the docker-compose as the `API_URL` environment variable.
|
||||
3. The mealie-data volume is mounted to BOTH the mealie-frontend and mealie-api containers. This is REQUIRED to ensure that images and assets are severed up correctly. While the default configuration is a docker-volume, that same can be accomplished by using a local directory mounted to the containers.
|
||||
3. The mealie-data volume is mounted to BOTH the mealie-frontend and mealie-api containers. This is REQUIRED to ensure that images and assets are served up correctly. While the default configuration is a docker-volume, that same can be accomplished by using a local directory mounted to the containers.
|
||||
|
@ -33,7 +33,7 @@ This can be a plus or a minus depending on your use case. If you relied on the o
|
||||
|
||||
## Step 1: Setting Up The New Application
|
||||
|
||||
Given the nature of the upgrade, it is highly recommended that you standup a new instance of mealie along side your current instance. This will allow you to migrate your data safely and quickly without any issues. Follow the instructions in the [Installation Checklist](../getting-started/installation/installation-checklist.md) to get started. Once that's complete and you can login, continue here with step 2.
|
||||
Given the nature of the upgrade, it is highly recommended that you stand up a new instance of mealie along side your current instance. This will allow you to migrate your data safely and quickly without any issues. Follow the instructions in the [Installation Checklist](../getting-started/installation/installation-checklist.md) to get started. Once that's complete and you can login, continue here with step 2.
|
||||
|
||||
## Step 2: Exporting Your Data from Pre-v1
|
||||
|
||||
@ -42,7 +42,7 @@ In your instance of Mealie prior to v1, perform an export of your data in the Ad
|
||||
|
||||
## Step 3: Using the Migration Tool
|
||||
|
||||
In your new v1 instance, navigate to `/group/migrations` and select "Mealie" from the dropdown selector. Upload the exported data from your pre-v1 instance. Optionally, you can tag all the recipes you've imported with the `mealie_alpha` tag to help you identify them. Once the upload has finished, submit the form and your migration will begin. This may take some time, but when it's complete you'll be provided a new entry in hte "Previous Migrations" table below. Be sure to review the migration report to make sure everything was successful. There may be instances where some of the recipes were not imported, but the migration will still import all the successful recipes.
|
||||
In your new v1 instance, navigate to `/group/migrations` and select "Mealie" from the dropdown selector. Upload the exported data from your pre-v1 instance. Optionally, you can tag all the recipes you've imported with the `mealie_alpha` tag to help you identify them. Once the upload has finished, submit the form and your migration will begin. This may take some time, but when it's complete you'll be provided a new entry in the "Previous Migrations" table below. Be sure to review the migration report to make sure everything was successful. There may be instances where some of the recipes were not imported, but the migration will still import all the successful recipes.
|
||||
|
||||
In most cases, it's faster to manually migrate the recipes that didn't take instead of trying to identify why the recipes failed to import. If you're experiencing issues with the migration tool, please open an issue on GitHub.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Backups and Restoring
|
||||
|
||||
Mealie provides an integrated mechanics for doing full installation backups of the database. Naviate to `/admin/backups` to
|
||||
Mealie provides an integrated mechanics for doing full installation backups of the database. Navigate to `/admin/backups` to
|
||||
|
||||
- See a list of available backups
|
||||
- Perform a backups
|
||||
|
@ -14,7 +14,7 @@ const routes = {
|
||||
};
|
||||
|
||||
export class BackupAPI extends BaseAPI {
|
||||
/** Returns a list of avaiable .zip files for import into Mealie.
|
||||
/** Returns a list of available .zip files for import into Mealie.
|
||||
*/
|
||||
async getAll() {
|
||||
return await this.requests.get<AllBackups>(routes.backupsAvailable);
|
||||
|
@ -8,7 +8,7 @@ const routes = {
|
||||
};
|
||||
|
||||
export class RegisterAPI extends BaseAPI {
|
||||
/** Returns a list of avaiable .zip files for import into Mealie.
|
||||
/** Returns a list of available .zip files for import into Mealie.
|
||||
*/
|
||||
async register(payload: CreateUserRegistration) {
|
||||
return await this.requests.post<any>(routes.register, payload);
|
||||
|
@ -44,7 +44,7 @@ export default defineComponent({
|
||||
},
|
||||
image: {
|
||||
type: String,
|
||||
requried: false,
|
||||
required: false,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
|
@ -56,7 +56,7 @@ export const LOCALES = [
|
||||
progress: 4,
|
||||
},
|
||||
{
|
||||
name: "Português (Portugese)",
|
||||
name: "Português (Portuguese)",
|
||||
value: "pt-PT",
|
||||
progress: 10,
|
||||
},
|
||||
|
@ -3,7 +3,7 @@ import { useUserApi } from "~/composables/api";
|
||||
import { UserIn, UserOut } from "~/types/api-types/user";
|
||||
|
||||
/*
|
||||
TODO: Potentiall combine useAllUsers and useUser by delaying the get all users functinality
|
||||
TODO: Potentially combine useAllUsers and useUser by delaying the get all users functionality
|
||||
Unsure how this could work but still be clear and functional. Perhaps by passing arguments to the useUsers function
|
||||
to control whether the object is substantiated... but some of the others rely on it being substantiated...Will come back to this.
|
||||
*/
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
<section v-if="group">
|
||||
<BaseCardSectionTitle class="mt-10" title="Default Recipe Preferences">
|
||||
These are the default settings when a new recipe is created in your group. These can be changed for indivdual
|
||||
These are the default settings when a new recipe is created in your group. These can be changed for individual
|
||||
recipes in the recipe settings menu.
|
||||
</BaseCardSectionTitle>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<v-card-title class="headline"> Recipe Bulk Importer </v-card-title>
|
||||
<v-card-text>
|
||||
The Bulk recipe importer allows you to import multiple recipes at once by queing the sites on the backend and
|
||||
The Bulk recipe importer allows you to import multiple recipes at once by queueing the sites on the backend and
|
||||
running the task in the background. This can be useful when initially migrating to Mealie, or when you want to
|
||||
import a large number of recipes.
|
||||
</v-card-text>
|
||||
|
@ -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
|
||||
|
@ -32,7 +32,7 @@ def test_admin_about_get_app_statistics(api_client: TestClient, admin_user: Test
|
||||
|
||||
as_dict = response.json()
|
||||
|
||||
# Smoke Test - Test the endpoint returns something thats a number
|
||||
# Smoke Test - Test the endpoint returns something that's a number
|
||||
assert as_dict["totalRecipes"] >= 0
|
||||
assert as_dict["uncategorizedRecipes"] >= 0
|
||||
assert as_dict["untaggedRecipes"] >= 0
|
||||
@ -45,7 +45,7 @@ def test_admin_about_check_app_config(api_client: TestClient, admin_user: TestUs
|
||||
|
||||
as_dict = response.json()
|
||||
|
||||
# Smoke Test - Test the endpoint returns something thats a the expected shape
|
||||
# Smoke Test - Test the endpoint returns something that's a the expected shape
|
||||
assert as_dict["emailReady"] in [True, False]
|
||||
assert as_dict["ldapReady"] in [True, False]
|
||||
assert as_dict["baseUrlSet"] in [True, False]
|
||||
|
@ -9,7 +9,7 @@ from tests.utils.fixture_schemas import TestUser
|
||||
|
||||
class Routes:
|
||||
self = "/api/groups/self"
|
||||
memebers = "/api/groups/members"
|
||||
members = "/api/groups/members"
|
||||
permissions = "/api/groups/permissions"
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ def get_permissions_payload(user_id: str, can_manage=None) -> dict:
|
||||
def test_get_group_members(api_client: TestClient, user_tuple: list[TestUser]):
|
||||
usr_1, usr_2 = user_tuple
|
||||
|
||||
response = api_client.get(Routes.memebers, headers=usr_1.token)
|
||||
response = api_client.get(Routes.members, headers=usr_1.token)
|
||||
assert response.status_code == 200
|
||||
|
||||
members = response.json()
|
||||
|
@ -140,7 +140,7 @@ def test_bulk_export_recipes(api_client: TestClient, unique_user: TestUser, ten_
|
||||
|
||||
assert validate_file_token(response_data["fileToken"]) == Path(export_path)
|
||||
|
||||
# Use Export Token to donwload export
|
||||
# Use Export Token to download export
|
||||
response = api_client.get(f'/api/utils/download?token={response_data["fileToken"]}')
|
||||
|
||||
assert response.status_code == 200
|
||||
|
@ -41,7 +41,7 @@ def test_user_token_refresh(api_client: TestClient, api_routes: AppRoutes, admin
|
||||
|
||||
def test_user_lockout_after_bad_attemps(api_client: TestClient, unique_user: TestUser, database: AllRepositories):
|
||||
"""
|
||||
if the user has more than 5 bad login attemps the user will be locked out for 4 hours
|
||||
if the user has more than 5 bad login attempts the user will be locked out for 4 hours
|
||||
This only applies if there is a user in the database with the same username
|
||||
"""
|
||||
routes = AppRoutes()
|
||||
|
@ -39,7 +39,7 @@ test_ingredients = [
|
||||
def test_nlp_parser():
|
||||
models: list[CRFIngredient] = convert_list_to_crf_model([x.input for x in test_ingredients])
|
||||
|
||||
# Itterate over mdoels and test_ingreidnets to gether
|
||||
# Iterate over models and test_ingredients to gather
|
||||
for model, test_ingredient in zip(models, test_ingredients):
|
||||
assert round(float(sum(Fraction(s) for s in model.qty.split())), 3) == pytest.approx(test_ingredient.quantity)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user