mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #155963: Odd entries in the Keymap dropdown
Caused by a0dafebac9
Skip subdirectories for keyconfig folder. New boolean fn parameter added
that decides whether to include subdirs or not
Pull Request: https://projects.blender.org/blender/blender/pulls/155998
This commit is contained in:
parent
ddf5e948e8
commit
ae0b4cdff9
2 changed files with 3 additions and 1 deletions
|
|
@ -1213,6 +1213,7 @@ class Menu(_StructRNA, _GenericUI, metaclass=_RNAMeta):
|
|||
add_operator=None,
|
||||
add_operator_props=None,
|
||||
translate=True,
|
||||
recursive_paths=False,
|
||||
):
|
||||
"""
|
||||
Populate a menu from a list of paths.
|
||||
|
|
@ -1257,7 +1258,7 @@ class Menu(_StructRNA, _GenericUI, metaclass=_RNAMeta):
|
|||
for entry in os.scandir(directory):
|
||||
if entry.name.startswith("."):
|
||||
continue
|
||||
if entry.is_dir():
|
||||
if entry.is_dir() and recursive_paths:
|
||||
subdirs.append((entry.name, entry.path))
|
||||
continue
|
||||
if (filter_ext is not None) and (not filter_ext(os.path.splitext(entry.name)[1])):
|
||||
|
|
|
|||
|
|
@ -290,6 +290,7 @@ class TEXT_MT_templates_py(Menu):
|
|||
props_default={"internal": True},
|
||||
filter_ext=lambda ext: (ext.lower() == ".py"),
|
||||
translate=False,
|
||||
recursive_paths=True,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue