fix: linter

This commit is contained in:
Exequiel Arona 2024-04-25 13:17:12 -03:00
parent 66de44be84
commit 0da9dd8aaa
2 changed files with 15 additions and 4 deletions

View file

@ -8,6 +8,7 @@ EXCLUDE_SELECT_OPTIONS = [
"minimum_password_score",
]
def extract(fileobj, *args, **kwargs):
"""
Extract messages from DocType JSON files. To be used to babel extractor
@ -15,7 +16,7 @@ def extract(fileobj, *args, **kwargs):
:rtype: `iterator`
"""
data = json.load(fileobj)
if not isinstance(data, list):
return
@ -37,7 +38,10 @@ def extract(fileobj, *args, **kwargs):
if description := field.get("description"):
messages.append(
(description, f"Description of the '{_label}' ({fieldtype}) Custom Field in DocType '{doctype}'")
(
description,
f"Description of the '{_label}' ({fieldtype}) Custom Field in DocType '{doctype}'",
)
)
if message := field.get("options"):

View file

@ -8,6 +8,7 @@ EXCLUDE_SELECT_OPTIONS = [
"minimum_password_score",
]
def extract(fileobj, *args, **kwargs):
"""
Extract messages from DocType JSON files. To be used to babel extractor
@ -37,7 +38,10 @@ def extract(fileobj, *args, **kwargs):
if description := field.get("description"):
messages.append(
(description, f"Description of the '{_label}' ({fieldtype}) field in Customization of DocType '{doctype}'")
(
description,
f"Description of the '{_label}' ({fieldtype}) field in Customization of DocType '{doctype}'",
)
)
if message := field.get("options"):
@ -59,7 +63,10 @@ def extract(fileobj, *args, **kwargs):
)
elif fieldtype == "HTML":
messages.append(
(message, f"Content of the '{_label}' ({fieldtype}) field in Customization of DocType '{doctype}'")
(
message,
f"Content of the '{_label}' ({fieldtype}) field in Customization of DocType '{doctype}'",
)
)
# By using "pgettext" as the function name we can supply the doctype as context