scripts/*.py: update coding style (#10761)
* convert to f string * use a next function instead of a for-loop * remove uneeded else statement * use in operator instead of multi comparison * conver to f string * adds extra line between function defs * revert/change to PR comment around looping * remove uneeded loops * revert to keep old style choice
This commit is contained in:
@@ -56,11 +56,10 @@ def get_tldr_root():
|
||||
|
||||
if "TLDR_ROOT" in os.environ:
|
||||
return os.environ["TLDR_ROOT"]
|
||||
else:
|
||||
print(
|
||||
"\x1b[31mPlease set TLDR_ROOT to the location of a clone of https://github.com/tldr-pages/tldr."
|
||||
)
|
||||
sys.exit(1)
|
||||
print(
|
||||
"\x1b[31mPlease set TLDR_ROOT to the location of a clone of https://github.com/tldr-pages/tldr."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def set_link(file, link):
|
||||
@@ -88,9 +87,9 @@ def set_link(file, link):
|
||||
# build new line
|
||||
if locale == "hi":
|
||||
new_line = f"> {labels[locale]} <{link}>।\n"
|
||||
elif locale == "ja" or locale == "th":
|
||||
elif locale in ["ja", "th"]:
|
||||
new_line = f"> {labels[locale]} <{link}>\n"
|
||||
elif locale == "zh" or locale == "zh_TW":
|
||||
elif locale in ["zh", "zh_TW"]:
|
||||
new_line = f"> {labels[locale]}<{link}>.\n"
|
||||
else:
|
||||
new_line = f"> {labels[locale]} <{link}>.\n"
|
||||
|
Reference in New Issue
Block a user