mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-21 16:31:21 -05:00
fix: Upgrade Black (#3057)
* bump black * bump black on precommit * run black * fix backend test runner
This commit is contained in:
@@ -9,8 +9,7 @@ from mealie.services.backups_v2.alchemy_exporter import AlchemyExporter
|
||||
from mealie.services.backups_v2.backup_file import BackupFile
|
||||
|
||||
|
||||
class BackupSchemaMismatch(Exception):
|
||||
...
|
||||
class BackupSchemaMismatch(Exception): ...
|
||||
|
||||
|
||||
class BackupV2(BaseService):
|
||||
|
||||
@@ -73,8 +73,7 @@ class Message:
|
||||
|
||||
class ABCEmailSender(ABC):
|
||||
@abstractmethod
|
||||
def send(self, email_to: str, subject: str, html: str) -> bool:
|
||||
...
|
||||
def send(self, email_to: str, subject: str, html: str) -> bool: ...
|
||||
|
||||
|
||||
class DefaultEmailSender(ABCEmailSender, BaseService):
|
||||
|
||||
@@ -100,9 +100,12 @@ class AppriseEventListener(EventListenerBase):
|
||||
|
||||
return [
|
||||
# We use query params to add custom key: value pairs to the Apprise payload by prepending the key with ":".
|
||||
AppriseEventListener.merge_query_parameters(url, {f":{k}": v for k, v in params.items()})
|
||||
# only certain endpoints support the custom key: value pairs, so we only apply them to those endpoints
|
||||
if AppriseEventListener.is_custom_url(url) else url
|
||||
(
|
||||
AppriseEventListener.merge_query_parameters(url, {f":{k}": v for k, v in params.items()})
|
||||
# only certain endpoints support the custom key: value pairs, so we only apply them to those endpoints
|
||||
if AppriseEventListener.is_custom_url(url)
|
||||
else url
|
||||
)
|
||||
for url in urls
|
||||
]
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ from mealie.services.event_bus_service.event_types import Event
|
||||
|
||||
|
||||
class PublisherLike(Protocol):
|
||||
def publish(self, event: Event, notification_urls: list[str]):
|
||||
...
|
||||
def publish(self, event: Event, notification_urls: list[str]): ...
|
||||
|
||||
|
||||
class ApprisePublisher:
|
||||
|
||||
@@ -37,12 +37,10 @@ class ABCExporter(BaseService):
|
||||
super().__init__()
|
||||
|
||||
@abstractproperty
|
||||
def destination_dir(self) -> str:
|
||||
...
|
||||
def destination_dir(self) -> str: ...
|
||||
|
||||
@abstractmethod
|
||||
def items(self) -> Iterator[ExportedItem]:
|
||||
...
|
||||
def items(self) -> Iterator[ExportedItem]: ...
|
||||
|
||||
def _post_export_hook(self, _: BaseModel) -> None:
|
||||
pass
|
||||
|
||||
@@ -106,12 +106,10 @@ class ABCIngredientParser(ABC):
|
||||
return 70
|
||||
|
||||
@abstractmethod
|
||||
def parse_one(self, ingredient_string: str) -> ParsedIngredient:
|
||||
...
|
||||
def parse_one(self, ingredient_string: str) -> ParsedIngredient: ...
|
||||
|
||||
@abstractmethod
|
||||
def parse(self, ingredients: list[str]) -> list[ParsedIngredient]:
|
||||
...
|
||||
def parse(self, ingredients: list[str]) -> list[ParsedIngredient]: ...
|
||||
|
||||
@classmethod
|
||||
def find_match(cls, match_value: str, *, store_map: dict[str, T], fuzzy_match_threshold: int = 0) -> T | None:
|
||||
|
||||
@@ -82,8 +82,7 @@ class ABCScraperStrategy(ABC):
|
||||
self.url = url
|
||||
|
||||
@abstractmethod
|
||||
async def get_html(self, url: str) -> str:
|
||||
...
|
||||
async def get_html(self, url: str) -> str: ...
|
||||
|
||||
@abstractmethod
|
||||
async def parse(self) -> tuple[Recipe, ScrapedExtras] | tuple[None, None]:
|
||||
|
||||
Reference in New Issue
Block a user