diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-08 11:30:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-08 11:30:20 +0400 |
commit | b58f41e1203500d2b54e9ae8a3a07ea66e43671f (patch) | |
tree | 34d09eeeec83d18d9041265edbf416e092cc42b0 /release/scripts/modules/bpy/path.py | |
parent | 1a41d2fc2938710fe2673bae9702a534f7f94d58 (diff) |
addon improvements/fixes
- better error reporting when an addon fails to load
- upload an addon which loads partly but then fails (eg, module loads but class register fails)
- bugfix addon loading, failier to load would leave _bpy_types._register_immediate = False
- added which change on disk are reloaded when enabling.
- bpy.path.module_names() now returns (module_name, module_path) pairs.
Diffstat (limited to 'release/scripts/modules/bpy/path.py')
-rw-r--r-- | release/scripts/modules/bpy/path.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index 714a3a07f95..a5b86b917b2 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -183,7 +183,7 @@ def module_names(path, recursive=False): :type path: string :arg recursive: Also return submodule names for packages. :type recursive: bool - :return: a list of strings. + :return: a list of string pairs (module_name, module_file). :rtype: list """ @@ -193,13 +193,15 @@ def module_names(path, recursive=False): for filename in sorted(_os.listdir(path)): if filename.endswith(".py") and filename != "__init__.py": - modules.append(filename[0:-3]) + fullpath = join(path, filename) + modules.append((filename[0:-3], fullpath)) elif ("." not in filename): directory = join(path, filename) - if isfile(join(directory, "__init__.py")): - modules.append(filename) + fullpath = join(directory, "__init__.py") + if isfile(fullpath): + modules.append((filename, fullpath)) if recursive: - for mod_name in module_names(directory, True): - modules.append("%s.%s" % (filename, mod_name)) + for mod_name, mod_path in module_names(directory, True): + modules.append(("%s.%s" % (filename, mod_name), mod_path)) return modules |