Add option background_image_anchor to configure bgimage position

This commit is contained in:
itepechi
2021-10-30 04:34:32 +09:00
parent ee852cf5fc
commit 2aa01c58a1
14 changed files with 104 additions and 11 deletions
+8
View File
@@ -57,6 +57,14 @@ class Parser:
def background_image(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['background_image'] = config_or_absolute_path(val)
def background_image_anchor(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
val = val.lower()
if val not in self.choices_for_background_image_anchor:
raise ValueError(f"The value {val} is not a valid choice for background_image_anchor")
ans["background_image_anchor"] = val
choices_for_background_image_anchor = frozenset(('northwest', 'north', 'northeast', 'east', 'southeast', 'south', 'southwest', 'west', 'center'))
def background_image_layout(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
val = val.lower()
if val not in self.choices_for_background_image_layout: