diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-31 16:47:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-31 16:47:10 +0300 |
commit | d924998d3e65334c5db2257c5dc4335261adc288 (patch) | |
tree | 2b46006f90936cd859972c0dc4174a3deab21bcf /release/scripts/modules | |
parent | 0f3f117311d25805fa1591aa2eed3240e50c4a6f (diff) |
Cleanup: pep8
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy/path.py | 24 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/image_utils.py | 8 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/io_utils.py | 6 | ||||
-rw-r--r-- | release/scripts/modules/bpy_types.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/sys_info.py | 1 |
5 files changed, 24 insertions, 17 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index db4c8da30f0..99c46e4b034 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -69,19 +69,23 @@ def abspath(path, start=None, library=None): if isinstance(path, bytes): if path.startswith(b"//"): if library: - start = _os.path.dirname(abspath(_getattr_bytes(library, "filepath"))) - return _os.path.join(_os.path.dirname(_getattr_bytes(_bpy.data, "filepath")) - if start is None else start, - path[2:], - ) + start = _os.path.dirname( + abspath(_getattr_bytes(library, "filepath"))) + return _os.path.join( + _os.path.dirname(_getattr_bytes(_bpy.data, "filepath")) + if start is None else start, + path[2:], + ) else: if path.startswith("//"): if library: - start = _os.path.dirname(abspath(library.filepath)) - return _os.path.join(_os.path.dirname(_bpy.data.filepath) - if start is None else start, - path[2:], - ) + start = _os.path.dirname( + abspath(library.filepath)) + return _os.path.join( + _os.path.dirname(_bpy.data.filepath) + if start is None else start, + path[2:], + ) return path diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index ad774cd1bda..f197596fec0 100644 --- a/release/scripts/modules/bpy_extras/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py @@ -62,11 +62,13 @@ def load_image(imagepath, :type convert_callback: function :arg relpath: If not None, make the file relative to this path. :type relpath: None or string - :arg check_existing: If true, returns already loaded image datablock if possible + :arg check_existing: If true, + returns already loaded image datablock if possible (based on file path). :type check_existing: bool - :arg force_reload: If true, force reloading of image (only useful when `check_existing` - is also enabled). + :arg force_reload: If true, + force reloading of image (only useful when `check_existing` + is also enabled). :type force_reload: bool :return: an image or None :rtype: :class:`bpy.types.Image` diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index 65ccc3f8dc3..a7ecd0b80c0 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -137,7 +137,8 @@ def orientation_helper_factory(name, axis_forward='Y', axis_up='Z'): def _update_axis_forward(self, context): if self.axis_forward[-1] == self.axis_up[-1]: - self.axis_up = self.axis_up[0:-1] + 'XYZ'[('XYZ'.index(self.axis_up[-1]) + 1) % 3] + self.axis_up = (self.axis_up[0:-1] + + 'XYZ'[('XYZ'.index(self.axis_up[-1]) + 1) % 3]) members['axis_forward'] = EnumProperty( name="Forward", @@ -154,7 +155,8 @@ def orientation_helper_factory(name, axis_forward='Y', axis_up='Z'): def _update_axis_up(self, context): if self.axis_up[-1] == self.axis_forward[-1]: - self.axis_forward = self.axis_forward[0:-1] + 'XYZ'[('XYZ'.index(self.axis_forward[-1]) + 1) % 3] + self.axis_forward = (self.axis_forward[0:-1] + + 'XYZ'[('XYZ'.index(self.axis_forward[-1]) + 1) % 3]) members['axis_up'] = EnumProperty( name="Up", diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 830db976822..e21b34adc4e 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -208,7 +208,7 @@ class _GenericBone: @property def basename(self): """The name of this bone before any '.' character""" - #return self.name.rsplit(".", 1)[0] + # return self.name.rsplit(".", 1)[0] return self.name.split(".")[0] @property diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index 382cb181d5f..49395dd48f0 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -40,7 +40,6 @@ def write_sysinfo(filepath): r = r[1:-1] return r - output = open(filepath, 'w', encoding="utf-8") header = "= Blender %s System Information =\n" % bpy.app.version_string |