Changeset View
Standalone View
release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
| Show First 20 Lines • Show All 956 Lines • ▼ Show 20 Lines | def dump_addon_messages(module_name, do_checks, settings): | ||||
| # Restore previous state if needed! | # Restore previous state if needed! | ||||
| if was_loaded: | if was_loaded: | ||||
| utils.enable_addons(addons={module_name}) | utils.enable_addons(addons={module_name}) | ||||
| # and make the diff! | # and make the diff! | ||||
| for key in minus_msgs: | for key in minus_msgs: | ||||
| if key != settings.PO_HEADER_KEY: | if key != settings.PO_HEADER_KEY: | ||||
| if key in msgs: | |||||
| del msgs[key] | del msgs[key] | ||||
| else: | |||||
| # This should not happen, but some messages seem to have | |||||
| # leaked on add-on unregister and register? | |||||
| print(f"Key not found in msgs: {key}") | |||||
mont29: This is likely due to add-ons not properly un-registering their data... Could be specified in… | |||||
Done Inline ActionsHonestly it’s like dark magic to me! Here is an example of errors I printed when trying to export messages for AnimAll: Key not found in msgs: (' matching of objects', 'tion to get the best possible match between source and destination meshes.\nWarning: Results will never be as good as manual matching of objects')
Key not found in msgs: ('*', 'best possible match between source and destination meshes.\nWarning: Results will never be as good as manual matching of objects')These are both parts of bpy.types.OBJECT_OT_data_transfer.use_auto_transform, so completely unrelated to AnimAll. It seems really fishy that parts of the message wound up in both the context and the message, right? I tried to follow the logic to understand how RNA is walked and all that but it’s too much for me just yet! So it could well be an unregister error, but it’s not clear enough to me, and I wouldn’t know how to formulate the message… pioverfour: Honestly it’s like dark magic to me! Here is an example of errors I printed when trying to… | |||||
Not Done Inline ActionsOK... Can't spot anything wrong on first sight in animall code, so will wait for this pathc to be committed and will try to investigate further. BTW, a bit unrelated, but unregistration of translations in that add-on should rather happen at the start of the unregister function. By principle, it's better to always unregister exactly in the inverse order of registration. mont29: OK... Can't spot anything wrong on first sight in animall code, so will wait for this pathc to… | |||||
Done Inline ActionsNote that the issue does not happen every single time, but AnimAll is not the only add-on affected, I’ve tried several and they were all—with different messages, though. Thanks for the unregister tip, I’ll fix it! pioverfour: Note that the issue does not happen every single time, but AnimAll is not the only add-on… | |||||
| if check_ctxt: | if check_ctxt: | ||||
| _diff_check_ctxt(check_ctxt, minus_check_ctxt) | _diff_check_ctxt(check_ctxt, minus_check_ctxt) | ||||
| # and we are done with those! | # and we are done with those! | ||||
| del minus_pot | del minus_pot | ||||
| del minus_msgs | del minus_msgs | ||||
| del minus_check_ctxt | del minus_check_ctxt | ||||
| ▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines | |||||
This is likely due to add-ons not properly un-registering their data... Could be specified in the comment maybe?