I18n: fix add-on extraction when UI code appears in __init__.py #106435

Merged
Bastien Montagne merged 1 commits from pioverfour/blender:dp_fix_addon_message_extraction into main 2023-04-04 10:07:18 +02:00
1 changed files with 2 additions and 1 deletions

View File

@ -753,7 +753,8 @@ def dump_py_messages(msgs, reports, addons, settings, addons_only=False):
return []
if os.path.isdir(path):
return [os.path.join(dpath, fn) for dpath, _, fnames in os.walk(path) for fn in fnames
if not fn.startswith("_") and fn.endswith(".py")]
if fn.endswith(".py") and (fn == "__init__.py"
pioverfour marked this conversation as resolved Outdated

removing the check is not the way to go, it is intended to not parse 'private' files conventionally named like _my_private_module.py. Think it should rather make an explicit exception for __init__.py.

removing the check is not the way to go, it is intended to not parse 'private' files conventionally named like `_my_private_module.py`. Think it should rather make an explicit exception for `__init__.py`.
Review

I see, I didn’t know of this convention for files. The only files making use of it in the Blender repos appear to be presets, so it shouldn’t be a problem!

I see, I didn’t know of this convention for files. The only files making use of it in the Blender repos appear to be presets, so it shouldn’t be a problem!
or not fn.startswith("_"))]
return [path]
files = []