[Bf-blender-cvs] [ca983d1] master: Cleanup: pep8
Campbell Barton
noreply at git.blender.org
Sat Jul 30 06:42:41 CEST 2016
Commit: ca983d1825fdef95688368da5fb4224bb4a12349
Author: Campbell Barton
Date: Fri Jul 29 21:22:27 2016 +1000
Branches: master
https://developer.blender.org/rBca983d1825fdef95688368da5fb4224bb4a12349
Cleanup: pep8
===================================================================
M release/scripts/modules/addon_utils.py
M release/scripts/modules/bpy/__init__.py
M release/scripts/modules/bpy/path.py
M release/scripts/modules/bpy_extras/keyconfig_utils.py
M release/scripts/modules/bpy_extras/view3d_utils.py
M release/scripts/modules/bpy_restrict_state.py
M release/scripts/modules/bpy_types.py
M release/scripts/modules/console/complete_import.py
M release/scripts/modules/console/complete_namespace.py
M release/scripts/modules/console/intellisense.py
M release/scripts/modules/console_python.py
M release/scripts/modules/progress_report.py
M release/scripts/modules/rna_info.py
M release/scripts/modules/rna_xml.py
M release/scripts/modules/sys_info.py
===================================================================
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index 95c0e5f..0f096f5 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -26,7 +26,7 @@ __all__ = (
"disable",
"reset_all",
"module_bl_info",
- )
+)
import bpy as _bpy
_user_preferences = _bpy.context.user_preferences
@@ -458,7 +458,7 @@ def module_bl_info(mod, info_basis=None):
"category": "",
"warning": "",
"show_expanded": False,
- }
+ }
addon_info = getattr(mod, "bl_info", {})
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py
index f012c13..26fdbc8 100644
--- a/release/scripts/modules/bpy/__init__.py
+++ b/release/scripts/modules/bpy/__init__.py
@@ -31,7 +31,7 @@ __all__ = (
"props",
"types",
"utils",
- )
+)
# internal blender C module
@@ -57,11 +57,11 @@ def main():
# fake module to allow:
# from bpy.types import Panel
sys.modules.update({
- "bpy.app": app,
- "bpy.app.handlers": app.handlers,
- "bpy.app.translations": app.translations,
- "bpy.types": types,
- })
+ "bpy.app": app,
+ "bpy.app.handlers": app.handlers,
+ "bpy.app.translations": app.translations,
+ "bpy.types": types,
+ })
# Initializes Python classes.
# (good place to run a profiler or trace).
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index 30f6c8e..a864a86 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -39,16 +39,16 @@ __all__ = (
"reduce_dirs",
"relpath",
"resolve_ncase",
- )
+)
import bpy as _bpy
import os as _os
from _bpy_path import (
- extensions_audio,
- extensions_movie,
- extensions_image,
- )
+ extensions_audio,
+ extensions_movie,
+ extensions_image,
+)
def _getattr_bytes(var, attr):
@@ -71,22 +71,22 @@ def abspath(path, start=None, library=None):
if path.startswith(b"//"):
if library:
start = _os.path.dirname(
- abspath(_getattr_bytes(library, "filepath")))
+ 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:],
- )
+ _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))
+ abspath(library.filepath))
return _os.path.join(
- _os.path.dirname(_bpy.data.filepath)
- if start is None else start,
- path[2:],
- )
+ _os.path.dirname(_bpy.data.filepath)
+ if start is None else start,
+ path[2:],
+ )
return path
@@ -175,7 +175,7 @@ def clean_name(name, replace="_"):
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe,
- )
+ )
trans = str.maketrans({char: replace for char in bad_chars})
trans_cache[replace] = trans
return trans
diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py
index 534dabf..ee0638e 100644
--- a/release/scripts/modules/bpy_extras/keyconfig_utils.py
+++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py
@@ -28,14 +28,14 @@ KM_HIERARCHY = [
('Screen', 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot
('Screen Editing', 'EMPTY', 'WINDOW', []), # re-sizing, action corners
('Header', 'EMPTY', 'WINDOW', []), # header stuff (per region)
- ]),
+ ]),
('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region)
('View2D Buttons List', 'EMPTY', 'WINDOW', []), # view 2d with buttons navigation
('User Interface', 'EMPTY', 'WINDOW', [
('Eyedropper Modal Map', 'EMPTY', 'WINDOW', []),
- ]),
+ ]),
('3D View', 'VIEW_3D', 'WINDOW', [ # view 3d navigation and generic stuff (select, transform)
('Object Mode', 'EMPTY', 'WINDOW', []),
@@ -71,18 +71,18 @@ KM_HIERARCHY = [
('View3D Dolly Modal', 'EMPTY', 'WINDOW', []),
('3D View Generic', 'VIEW_3D', 'WINDOW', []), # toolbar and properties
- ]),
+ ]),
('Graph Editor', 'GRAPH_EDITOR', 'WINDOW', [
('Graph Editor Generic', 'GRAPH_EDITOR', 'WINDOW', []),
- ]),
+ ]),
('Dopesheet', 'DOPESHEET_EDITOR', 'WINDOW', [
('Dopesheet Generic', 'DOPESHEET_EDITOR', 'WINDOW', []),
- ]),
+ ]),
('NLA Editor', 'NLA_EDITOR', 'WINDOW', [
('NLA Channels', 'NLA_EDITOR', 'WINDOW', []),
('NLA Generic', 'NLA_EDITOR', 'WINDOW', []),
- ]),
+ ]),
('Timeline', 'TIMELINE', 'WINDOW', []),
('Image', 'IMAGE_EDITOR', 'WINDOW', [
@@ -90,23 +90,23 @@ KM_HIERARCHY = [
('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d
('UV Sculpt', 'EMPTY', 'WINDOW', []),
('Image Generic', 'IMAGE_EDITOR', 'WINDOW', []),
- ]),
+ ]),
('Outliner', 'OUTLINER', 'WINDOW', []),
('Node Editor', 'NODE_EDITOR', 'WINDOW', [
('Node Generic', 'NODE_EDITOR', 'WINDOW', []),
- ]),
+ ]),
('Sequencer', 'SEQUENCE_EDITOR', 'WINDOW', [
('SequencerCommon', 'SEQUENCE_EDITOR', 'WINDOW', []),
('SequencerPreview', 'SEQUENCE_EDITOR', 'WINDOW', []),
- ]),
+ ]),
('Logic Editor', 'LOGIC_EDITOR', 'WINDOW', []),
('File Browser', 'FILE_BROWSER', 'WINDOW', [
('File Browser Main', 'FILE_BROWSER', 'WINDOW', []),
('File Browser Buttons', 'FILE_BROWSER', 'WINDOW', []),
- ]),
+ ]),
('Info', 'INFO', 'WINDOW', []),
@@ -114,17 +114,17 @@ KM_HIERARCHY = [
('Text', 'TEXT_EDITOR', 'WINDOW', [
('Text Generic', 'TEXT_EDITOR', 'WINDOW', []),
- ]),
+ ]),
('Console', 'CONSOLE', 'WINDOW', []),
('Clip', 'CLIP_EDITOR', 'WINDOW', [
('Clip Editor', 'CLIP_EDITOR', 'WINDOW', []),
('Clip Graph Editor', 'CLIP_EDITOR', 'WINDOW', []),
('Clip Dopesheet Editor', 'CLIP_EDITOR', 'WINDOW', []),
- ]),
+ ]),
('Grease Pencil', 'EMPTY', 'WINDOW', [ # grease pencil stuff (per region)
('Grease Pencil Stroke Edit Mode', 'EMPTY', 'WINDOW', []),
- ]),
+ ]),
('Mask Editing', 'EMPTY', 'WINDOW', []),
('Frames', 'EMPTY', 'WINDOW', []), # frame navigation (per region)
('Markers', 'EMPTY', 'WINDOW', []), # markers (per region)
@@ -138,7 +138,7 @@ KM_HIERARCHY = [
('Standard Modal Map', 'EMPTY', 'WINDOW', []),
('Transform Modal Map', 'EMPTY', 'WINDOW', []),
- ]
+]
# -----------------------------------------------------------------------------
@@ -239,7 +239,8 @@ def keyconfig_export(wm, kc, filepath):
" except Exception as e:\n"
" print(\"Warning: %r\" % e)\n\n")
f.write("wm = bpy.context.window_manager\n")
- f.write("kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])\n\n") # keymap must be created by caller
+ # keymap must be created by caller
+ f.write("kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])\n\n")
# Generate a list of keymaps to export:
#
@@ -267,7 +268,8 @@ def keyconfig_export(wm, kc, filepath):
km = km.active()
f.write("# Map %s\n" % km.name)
- f.write("km = kc.keymaps.new('%s', space_type='%s', region_type='%s', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.is_modal))
+ f.write("km = kc.keymaps.new('%s', space_type='%s', region_type='%s', modal=%s)\n\n" %
+ (km.name, km.space_type, km.region_type, km.is_modal))
for kmi in km.keymap_items:
f.write(_kmistr(kmi, km.is_modal))
f.write("\n")
diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py
index 5f83cdc..a4834a4 100644
--- a/release/scripts/modules/bpy_extras/view3d_utils.py
+++ b/release/scripts/modules/bpy_extras/view3d_utils.py
@@ -23,7 +23,7 @@ __all__ = (
"region_2d_to_origin_3d",
"region_2d_to_location_3d",
"location_3d_to_region_2d",
- )
+)
def region_2d_to_vector_3d(region, rv3d, coord):
@@ -50,7 +50,7 @@ def region_2d_to_vector_3d(region, rv3d, coord):
out = Vector(((2.0 * coord[0] / region.width) - 1.0,
(2.0 * coord[1] / region.height) - 1.0,
-0.5
- ))
+ ))
w = out.dot(persinv[3].xyz) + persinv[3][3]
diff --git a/release/scripts/modules/bpy_restrict_state.py b/release/scripts/modules/bpy_restrict_state.py
index 4658fdd..589b396 100644
--- a/release/scripts/modules/bpy_restrict_state.py
+++ b/release/scripts/modules/bpy_restrict_state.py
@@ -24,7 +24,7 @@ This module contains RestrictBlend context manager.
__all__ = (
"RestrictBlend",
- )
+)
import bpy as _bpy
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index d194de3..d64acd2 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -39,7 +39,7 @@ class Context(StructRNA):
generic_attrs = (
*StructRNA.__dict__.keys(),
"bl_rna", "rna_type", "copy",
- )
+ )
for attr in dir(self):
if not (attr.startswith("_") or attr in generic_attrs):
value = getattr(self, attr)
@@ -542,6 +542,7 @@ clas
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list