mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-09 12:02:39 +02: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 @@ def get_translation_ids_from_source():
|
||||
p2 = re.compile(r'\$t\("([^"]*)"')
|
||||
ids = []
|
||||
for fn in files:
|
||||
with open(fn, "rt") as f:
|
||||
with open(fn) as f:
|
||||
text = f.read()
|
||||
m1 = re.findall(p1, text)
|
||||
m2 = re.findall(p2, text)
|
||||
@@ -30,7 +30,7 @@ def get_translation_ids_from_source():
|
||||
|
||||
def get_translation_ids_for_language(language):
|
||||
ids = []
|
||||
for line in open(f"lnbits/static/i18n/{language}.js", "rt"):
|
||||
for line in open(f"lnbits/static/i18n/{language}.js"):
|
||||
# extract ids from lines like that start with exactly 2 spaces
|
||||
if line.startswith(" ") and not line.startswith(" "):
|
||||
m = line[2:].split(":")[0]
|
||||
|
Reference in New Issue
Block a user