Merge pull request #9490 from chennes/addExclusionToUpdatets
Tools: Add exclusion list to lupdate calls
This commit is contained in:
@@ -173,6 +173,16 @@ directories = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Exclude these files from consideration
|
||||||
|
excluded_files = [
|
||||||
|
("Path", "UtilsArguments.py"), # Causes lupdate to hang
|
||||||
|
("Path", "refactored_centroid_post.py"), # lupdate bug causes failure on line 245
|
||||||
|
("Path", "refactored_grbl_post.py"), # lupdate bug causes failure on line 212
|
||||||
|
("Path", "refactored_linuxcnc_post.py"), # lupdate bug causes failure on line 178
|
||||||
|
("Path", "refactored_mach3_mach4_post.py"), # lupdate bug causes failure on line 186
|
||||||
|
("Path", "refactored_test_post.py"), # lupdate bug causes failure on lines 42 and 179
|
||||||
|
]
|
||||||
|
|
||||||
QMAKE = ""
|
QMAKE = ""
|
||||||
LUPDATE = ""
|
LUPDATE = ""
|
||||||
PYLUPDATE = ""
|
PYLUPDATE = ""
|
||||||
@@ -328,10 +338,18 @@ def update_translation(entry):
|
|||||||
"qrc",
|
"qrc",
|
||||||
"py",
|
"py",
|
||||||
]
|
]
|
||||||
with open("files_to_translate.txt", "w") as file_list:
|
with open("files_to_translate.txt", "w", encoding="utf-8") as file_list:
|
||||||
for root, dirs, files in os.walk("./"):
|
for root, dirs, files in os.walk("./"):
|
||||||
for f in files:
|
for f in files:
|
||||||
if pathlib.Path(f).suffix[1:] in extensions:
|
skip = False
|
||||||
|
for exclusion in excluded_files:
|
||||||
|
if entry["tsname"] == exclusion[0] and f == exclusion[1]:
|
||||||
|
print(
|
||||||
|
f" (NOTE: Excluding file {f} because it is in the excluded_files list)"
|
||||||
|
)
|
||||||
|
skip = True
|
||||||
|
break
|
||||||
|
if not skip and pathlib.Path(f).suffix[1:] in extensions:
|
||||||
file_list.write(os.path.join(root, f) + "\n")
|
file_list.write(os.path.join(root, f) + "\n")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -350,14 +368,26 @@ def update_translation(entry):
|
|||||||
timeout=60,
|
timeout=60,
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
)
|
)
|
||||||
|
if not p:
|
||||||
|
raise RuntimeError("No return result from lupdate")
|
||||||
|
if not p.stdout:
|
||||||
|
raise RuntimeError("No stdout from lupdate")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print("*" * 80)
|
||||||
|
print("*" * 80)
|
||||||
|
print("*" * 80)
|
||||||
|
print(f"ERROR RUNNING lupdate -- TRANSLATIONS FOR {entry['tsname']} PROBABLY FAILED...")
|
||||||
print(str(e))
|
print(str(e))
|
||||||
|
print("*" * 80)
|
||||||
|
print("*" * 80)
|
||||||
|
print("*" * 80)
|
||||||
os.chdir(cur)
|
os.chdir(cur)
|
||||||
return
|
return
|
||||||
|
|
||||||
with open(f"{cur}/tsupdate_stdout.log", "a", encoding="utf-8") as f:
|
with open(f"{cur}/tsupdate_stdout.log", "a", encoding="utf-8") as f:
|
||||||
f.write(p.stdout)
|
f.write(p.stdout)
|
||||||
print(p.stdout)
|
print(p.stdout, flush=True)
|
||||||
|
|
||||||
with open(f"{cur}/tsupdate_stderr.log", "a", encoding="utf-8") as f:
|
with open(f"{cur}/tsupdate_stderr.log", "a", encoding="utf-8") as f:
|
||||||
f.write(p.stderr)
|
f.write(p.stderr)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user