Cleanup: make format

This commit is contained in:
Bastien Montagne
2024-08-19 14:26:53 +02:00
parent 60a467204c
commit c1aef6b4b0

View File

@@ -91,13 +91,13 @@ class UI_OT_i18n_updatetranslation_work_repo(Operator):
# ~ with concurrent.futures.ProcessPoolExecutor() as exctr:
# ~ pot = utils_i18n.I18nMessages(kind='PO', src=self.settings.FILE_NAME_POT, settings=self.settings)
# ~ for progress, _ in enumerate(
# ~ exctr.map(utils_i18n.I18nMessages.update_from_pot_callback,
# ~ (pot,) * num_langs,
# ~ [dict(lng.items()) for lng in i18n_sett.langs],
# ~ (self.settings,) * num_langs,
# ~ chunksize=4,
# ~ timeout=60)):
# ~ context.window_manager.progress_update(progress + 2)
# ~ exctr.map(utils_i18n.I18nMessages.update_from_pot_callback,
# ~ (pot,) * num_langs,
# ~ [dict(lng.items()) for lng in i18n_sett.langs],
# ~ (self.settings,) * num_langs,
# ~ chunksize=4,
# ~ timeout=60)):
# ~ context.window_manager.progress_update(progress + 2)
context.window_manager.progress_end()
print("", flush=True)
@@ -131,12 +131,12 @@ class UI_OT_i18n_cleanuptranslation_work_repo(Operator):
# FIXME: This can easily deadlock on powerful machine with lots of RAM (128GB) and cores (32)...
# ~ with concurrent.futures.ProcessPoolExecutor() as exctr:
# ~ for progress, _ in enumerate(
# ~ exctr.map(utils_i18n.I18nMessages.cleanup_callback,
# ~ [dict(lng.items()) for lng in i18n_sett.langs],
# ~ (self.settings,) * num_langs,
# ~ chunksize=4,
# ~ timeout=60)):
# ~ context.window_manager.progress_update(progress + 1)
# ~ exctr.map(utils_i18n.I18nMessages.cleanup_callback,
# ~ [dict(lng.items()) for lng in i18n_sett.langs],
# ~ (self.settings,) * num_langs,
# ~ chunksize=4,
# ~ timeout=60)):
# ~ context.window_manager.progress_update(progress + 1)
context.window_manager.progress_end()
print("", flush=True)
@@ -159,7 +159,8 @@ class UI_OT_i18n_updatetranslation_blender_repo(Operator):
context.window_manager.progress_begin(0, num_langs + 1)
context.window_manager.progress_update(0)
for progress, lng in enumerate(i18n_sett.langs):
lng_uid, stats_val, reports = utils_i18n.I18nMessages.update_to_blender_repo_callback(dict(lng.items()), self.settings)
lng_uid, stats_val, reports = utils_i18n.I18nMessages.update_to_blender_repo_callback(
dict(lng.items()), self.settings)
context.window_manager.progress_update(progress + 1)
stats[lng_uid] = stats_val
print("".join(reports) + "\n")
@@ -168,14 +169,14 @@ class UI_OT_i18n_updatetranslation_blender_repo(Operator):
# FIXME: This can easily deadlock on powerful machine with lots of RAM (128GB) and cores (32)...
# ~ with concurrent.futures.ProcessPoolExecutor() as exctr:
# ~ for progress, (lng_uid, stats_val, reports) in enumerate(
# ~ exctr.map(utils_i18n.I18nMessages.update_to_blender_repo_callback,
# ~ [dict(lng.items()) for lng in i18n_sett.langs],
# ~ (self.settings,) * num_langs,
# ~ chunksize=4,
# ~ timeout=60)):
# ~ context.window_manager.progress_update(progress + 1)
# ~ stats[lng_uid] = stats_val
# ~ print("".join(reports) + "\n")
# ~ exctr.map(utils_i18n.I18nMessages.update_to_blender_repo_callback,
# ~ [dict(lng.items()) for lng in i18n_sett.langs],
# ~ (self.settings,) * num_langs,
# ~ chunksize=4,
# ~ timeout=60)):
# ~ context.window_manager.progress_update(progress + 1)
# ~ stats[lng_uid] = stats_val
# ~ print("".join(reports) + "\n")
print("Generating languages' menu...", flush=True)
context.window_manager.progress_update(progress + 2)