diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-05-17 10:17:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-05-17 10:26:01 +0300 |
commit | 847ec075eb52664a9943b35dda6eb80acfc4f1cf (patch) | |
tree | eac558379fe7907804d13438f9712014f9d0090e | |
parent | 02cbc3c1e0be505724eb79f15d75adf6089063fe (diff) |
Cleanup: pep8
-rw-r--r-- | doc/python_api/examples/bpy.ops.2.py | 2 | ||||
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 12 | ||||
-rw-r--r-- | intern/cycles/blender/addon/__init__.py | 6 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 12 | ||||
-rw-r--r-- | release/scripts/modules/bpy/path.py | 3 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/io_utils.py | 8 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/object_utils.py | 13 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/view3d_utils.py | 10 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/object_align.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_game.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_filebrowser.py | 1 |
11 files changed, 49 insertions, 25 deletions
diff --git a/doc/python_api/examples/bpy.ops.2.py b/doc/python_api/examples/bpy.ops.2.py index 87a2022e526..dd88c73d5e9 100644 --- a/doc/python_api/examples/bpy.ops.2.py +++ b/doc/python_api/examples/bpy.ops.2.py @@ -1,6 +1,6 @@ +""" .. _operator-execution_context: -""" Execution Context ----------------- diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 72ddf251946..e5ce4c76142 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -455,9 +455,11 @@ ClassMethodDescriptorType = type(dict.__dict__['fromkeys']) MethodDescriptorType = type(dict.get) GetSetDescriptorType = type(int.real) StaticMethodType = type(staticmethod(lambda: None)) -from types import (MemberDescriptorType, - MethodType, - ) +from types import ( + MemberDescriptorType, + MethodType, + FunctionType, + ) _BPY_STRUCT_FAKE = "bpy_struct" _BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection" @@ -869,7 +871,7 @@ def pymodule2sphinx(basepath, module_name, module, title): module_dir_value_type.sort(key=lambda triple: str(triple[2])) for attribute, value, value_type in module_dir_value_type: - if value_type == types.FunctionType: + if value_type == FunctionType: pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False) elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof # note: can't get args from these, so dump the string as is @@ -939,7 +941,7 @@ def pymodule2sphinx(basepath, module_name, module, title): # needed for pure python classes for key, descr in descr_items: - if type(descr) == types.FunctionType: + if type(descr) == FunctionType: pyfunc2sphinx(" ", fw, module_name, type_name, key, descr, is_class=True) for key, descr in descr_items: diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py index 9c78e0c9a62..0783c1c4cba 100644 --- a/intern/cycles/blender/addon/__init__.py +++ b/intern/cycles/blender/addon/__init__.py @@ -30,8 +30,10 @@ bl_info = { import bpy -from . import engine -from . import version_update +from . import ( + engine, + version_update, + ) class CyclesRender(bpy.types.RenderEngine): diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 545d0b6c26c..430c0a964b1 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -18,7 +18,11 @@ import bpy -from bpy.types import Panel, Menu, Operator, UIList +from bpy.types import ( + Panel, + Menu, + Operator, + ) class CYCLES_MT_sampling_presets(Menu): @@ -55,6 +59,7 @@ def use_cpu(context): return (device_type == 'NONE' or cscene.device == 'CPU') + def use_branched_path(context): cscene = context.scene.cycles device_type = context.user_preferences.system.compute_device_type @@ -442,7 +447,6 @@ class CyclesRender_PT_views(CyclesButtonsPanel, Panel): rd = scene.render rv = rd.views.active - layout.active = rd.use_multiview basic_stereo = (rd.views_format == 'STEREO_3D') @@ -518,12 +522,12 @@ class CyclesCamera_PT_dof(CyclesButtonsPanel, Panel): sub = col.column(align=True) sub.label("Viewport:") subhq = sub.column() - subhq.active = hq_support; + subhq.active = hq_support subhq.prop(dof_options, "use_high_quality") sub.prop(dof_options, "fstop") if dof_options.use_high_quality and hq_support: sub.prop(dof_options, "blades") - + col = split.column() col.label("Aperture:") diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index 0012083ba98..be38fefbd2a 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -226,7 +226,8 @@ def resolve_ncase(path): if _os.path.isdir(dirpath): try: files = _os.listdir(dirpath) - except PermissionError: # We might not have the permission to list dirpath... + except PermissionError: + # We might not have the permission to list dirpath... return path, False else: return path, False diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index 32623e2bd25..65ccc3f8dc3 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -35,7 +35,11 @@ __all__ = ( ) import bpy -from bpy.props import StringProperty, BoolProperty, EnumProperty +from bpy.props import ( + StringProperty, + BoolProperty, + EnumProperty, + ) def _check_axis_conversion(op): @@ -368,7 +372,7 @@ def unpack_list(list_of_tuples): # same as above except that it adds 0 for triangle faces def unpack_face_list(list_of_tuples): - #allocate the entire list + # allocate the entire list flat_ls = [0] * (len(list_of_tuples) * 4) i = 0 diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 13ef86b23c0..16224144ee4 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -31,7 +31,10 @@ __all__ = ( import bpy -from bpy.props import BoolProperty, FloatVectorProperty +from bpy.props import ( + BoolProperty, + FloatVectorProperty, + ) def add_object_align_init(context, operator): @@ -171,7 +174,7 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name= obj_act.select = True scene.update() # apply location - #scene.objects.active = obj_new + # scene.objects.active = obj_new bpy.ops.object.join() # join into the active. if obdata: @@ -287,7 +290,8 @@ def world_to_camera_view(scene, obj, coord): Returns the camera space coords for a 3d point. (also known as: normalized device coordinates - NDC). - Where (0, 0) is the bottom left and (1, 1) is the top right of the camera frame. + Where (0, 0) is the bottom left and (1, 1) + is the top right of the camera frame. values outside 0-1 are also supported. A negative 'z' value means the point is behind the camera. @@ -300,7 +304,8 @@ def world_to_camera_view(scene, obj, coord): :type obj: :class:`bpy.types.Object` :arg coord: World space location. :type coord: :class:`mathutils.Vector` - :return: a vector where X and Y map to the view plane and Z is the depth on the view axis. + :return: a vector where X and Y map to the view plane and + Z is the depth on the view axis. :rtype: :class:`mathutils.Vector` """ from mathutils import Vector diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index b8f9bc730f7..4aa06262970 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -69,11 +69,13 @@ def region_2d_to_origin_3d(region, rv3d, coord, clamp=None): .. note:: - Orthographic views have a less obvious origin, the far clip is used to define the viewport near/far extents. - Since far clip can be a very large value, the result may give with numeric precision issues. + Orthographic views have a less obvious origin, + the far clip is used to define the viewport near/far extents. + Since far clip can be a very large value, + the result may give with numeric precision issues. - To avoid this problem, you can optionally clamp the far clip to a smaller value - based on the data you're operating on. + To avoid this problem, you can optionally clamp the far clip to a + smaller value based on the data you're operating on. :arg region: region of the 3D viewport, typically bpy.context.region. :type region: :class:`bpy.types.Region` diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py index 916a9f66915..7fb0924add5 100644 --- a/release/scripts/startup/bl_operators/object_align.py +++ b/release/scripts/startup/bl_operators/object_align.py @@ -340,7 +340,10 @@ def align_objects(context, return True -from bpy.props import EnumProperty, BoolProperty +from bpy.props import ( + EnumProperty, + BoolProperty + ) class AlignObjects(Operator): diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 6fb172bf1e3..ceeb45ac485 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -223,7 +223,7 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): row.prop(game, "collision_margin", text="Margin", slider=True) sub = row.row() - sub.active = game.physics_type not in {'SOFT_BODY', 'CHARACTER'} + sub.active = game.physics_type not in {'SOFT_BODY', 'CHARACTER'} sub.prop(game, "use_collision_compound", text="Compound") layout.separator() diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index bcf0495d00f..0d900a41f25 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -128,6 +128,7 @@ class FILEBROWSER_PT_system_folders(Panel): row.template_list("FILEBROWSER_UL_dir", "system_folders", space, "system_folders", space, "system_folders_active", item_dyntip_propname="path", rows=1, maxrows=10) + class FILEBROWSER_PT_system_bookmarks(Panel): bl_space_type = 'FILE_BROWSER' bl_region_type = 'TOOLS' |