black format
This commit is contained in:
parent
247fd37560
commit
238319b9e1
5 changed files with 23 additions and 4 deletions
|
@ -68,6 +68,7 @@ class Context:
|
|||
jsonschema.validate(instance=settingsdct, schema=settingsschema)
|
||||
self.settings.load(settingsdct)
|
||||
|
||||
|
||||
class Element:
|
||||
def __init__(self, ctx: Context) -> None:
|
||||
self.ctx = ctx
|
||||
|
@ -76,6 +77,7 @@ class Element:
|
|||
def from_dict(cls, ctx: Context, dct: Dict[str, Any]) -> Self:
|
||||
return cls(ctx)
|
||||
|
||||
|
||||
class Unit(Element):
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -119,7 +121,6 @@ class Unit(Element):
|
|||
self.conversions = conversions
|
||||
|
||||
|
||||
|
||||
class AUnits:
|
||||
def __init__(self, ctx: Context) -> None:
|
||||
self.ctx = ctx
|
||||
|
@ -171,6 +172,7 @@ class Units(AUnits):
|
|||
f"units.yaml: {unitname} should only have one entry, found {num}",
|
||||
)
|
||||
|
||||
|
||||
class IngredientInstance(Element):
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -236,6 +238,7 @@ class IngredientInstance(Element):
|
|||
price=price,
|
||||
)
|
||||
|
||||
|
||||
class StepSection(Element):
|
||||
def __init__(self, ctx: Context, title: str, steps: List[str]) -> None:
|
||||
self.title = title
|
||||
|
@ -245,6 +248,7 @@ class StepSection(Element):
|
|||
def from_dict(cls, ctx: Context, dct: Dict[str, Any]) -> Self:
|
||||
return cls(ctx, dct["section"], dct["steps"])
|
||||
|
||||
|
||||
class Recipe(Element):
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -334,6 +338,7 @@ class Recipe(Element):
|
|||
stepsections=stepsections,
|
||||
)
|
||||
|
||||
|
||||
class Conversion(Element):
|
||||
def __init__(
|
||||
self, ctx: Context, fromunit: Unit, tounit: Unit, ratio: float
|
||||
|
@ -354,6 +359,7 @@ class Conversion(Element):
|
|||
raise RuntimeError(f"unit {dct['to']} doesn't exist")
|
||||
return cls(ctx, fromunit, tounit, dct["ratio"])
|
||||
|
||||
|
||||
class Ingredient(Element):
|
||||
def __init__(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue