mirror of
https://github.com/lnbits/lnbits.git
synced 2025-12-14 06:31:38 +01:00
chore: adhere to ruff's UP
basically use `list` and `type` instead of `List` and `Type` this is save to use for python3.9 and has been deprecated. also has some performance drawbacks. read more here: https://docs.astral.sh/ruff/rules/non-pep585-annotation/
This commit is contained in:
@@ -17,7 +17,7 @@ assert os.getenv("OPENAI_API_KEY"), "OPENAI_API_KEY env var not set"
|
||||
|
||||
|
||||
def load_language(lang: str) -> dict:
|
||||
s = open(f"lnbits/static/i18n/{lang}.js", "rt").read()
|
||||
s = open(f"lnbits/static/i18n/{lang}.js").read()
|
||||
prefix = "window.localisation.%s = {\n" % lang
|
||||
assert s.startswith(prefix)
|
||||
s = s[len(prefix) - 2 :]
|
||||
@@ -27,7 +27,7 @@ def load_language(lang: str) -> dict:
|
||||
|
||||
|
||||
def save_language(lang: str, data) -> None:
|
||||
with open(f"lnbits/static/i18n/{lang}.js", "wt") as f:
|
||||
with open(f"lnbits/static/i18n/{lang}.js", "w") as f:
|
||||
f.write("window.localisation.%s = {\n" % lang)
|
||||
row = 0
|
||||
for k, v in data.items():
|
||||
|
||||
Reference in New Issue
Block a user