diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-25 00:01:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-25 00:01:45 +0400 |
commit | 4b3976cc5a26937724823d07fdcdeb317a4c3948 (patch) | |
tree | a5ef7b8e4959f9b18b66d75f2644ab531d6afcd5 /release/scripts/modules | |
parent | 45a3acc39838e3ab998b33d4d10e134a7927cd8a (diff) | |
parent | d0b7fb5fdf90f09748f94a21e205be7f31ebbb25 (diff) |
svn merge ^/trunk/blender -r42116:42139
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/addon_utils.py | 4 | ||||
-rw-r--r-- | release/scripts/modules/bpy/utils.py | 16 | ||||
-rw-r--r-- | release/scripts/modules/console/complete_calltip.py | 4 |
3 files changed, 13 insertions, 11 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index bcde4ce1e18..de662b47c4d 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -171,7 +171,9 @@ def modules(module_cache): mod = None if mod is None: - mod = fake_module(mod_name, mod_path, force_support=force_support) + mod = fake_module(mod_name, + mod_path, + force_support=force_support) if mod: module_cache[mod_name] = mod diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index 6eb16bd7e7a..cf3e92bdcbf 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -263,7 +263,7 @@ def user_script_path(): return None -def script_paths(subdir=None, user_pref=True, all=False): +def script_paths(subdir=None, user_pref=True, check_all=False): """ Returns a list of valid script paths. @@ -271,9 +271,9 @@ def script_paths(subdir=None, user_pref=True, all=False): :type subdir: string :arg user_pref: Include the user preference script path. :type user_pref: bool - :arg all: Include local, user and system paths rather just the paths + :arg check_all: Include local, user and system paths rather just the paths blender uses. - :type all: bool + :type check_all: bool :return: script paths. :rtype: list """ @@ -286,7 +286,7 @@ def script_paths(subdir=None, user_pref=True, all=False): else: user_script_path = None - if all: + if check_all: # all possible paths base_paths = tuple(_os.path.join(resource_path(res), "scripts") for res in ('LOCAL', 'USER', 'SYSTEM')) @@ -343,7 +343,7 @@ def preset_paths(subdir): :rtype: list """ dirs = [] - for path in script_paths("presets", all=True): + for path in script_paths("presets", check_all=True): directory = _os.path.join(path, subdir) if not directory.startswith(path): raise Exception("invalid subdir given %r" % subdir) @@ -432,9 +432,9 @@ def keyconfig_set(filepath): keyconfigs_old = keyconfigs[:] try: - file = open(filepath) - exec(compile(file.read(), filepath, 'exec'), {"__file__": filepath}) - file.close() + keyfile = open(filepath) + exec(compile(keyfile.read(), filepath, 'exec'), {"__file__": filepath}) + keyfile.close() except: import traceback traceback.print_exc() diff --git a/release/scripts/modules/console/complete_calltip.py b/release/scripts/modules/console/complete_calltip.py index 29187297707..3404bb792fa 100644 --- a/release/scripts/modules/console/complete_calltip.py +++ b/release/scripts/modules/console/complete_calltip.py @@ -72,7 +72,7 @@ def reduce_spaces(text): return RE_SPACE.sub(' ', text) -def get_doc(object): +def get_doc(obj): """Get the doc string or comments for an object. :param object: object @@ -82,7 +82,7 @@ def get_doc(object): >>> get_doc(abs) 'abs(number) -> number\\n\\nReturn the absolute value of the argument.' """ - result = inspect.getdoc(object) or inspect.getcomments(object) + result = inspect.getdoc(obj) or inspect.getcomments(obj) return result and RE_EMPTY_LINE.sub('', result.rstrip()) or '' |