Cleanup: imports, indentation, long lines

This commit is contained in:
Campbell Barton 2017-03-25 11:07:05 +11:00
parent a6f74453b6
commit 7cb2974182
11 changed files with 124 additions and 85 deletions

View File

@ -21,7 +21,10 @@ import bpy
import os
from bpy.types import Operator
from bpy.props import FloatProperty
from mathutils import Vector, Matrix
from mathutils import (
Vector,
Matrix,
)
def CLIP_spaces_walk(context, all_screens, tarea, tspace, callback, *args):
@ -1084,4 +1087,4 @@ classes = (
CLIP_OT_track_settings_as_default,
CLIP_OT_track_settings_to_track,
CLIP_OT_track_to_empty,
)
)

View File

@ -16,13 +16,15 @@
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from bpy.props import (
BoolProperty,
EnumProperty,
StringProperty,
)
BoolProperty,
EnumProperty,
StringProperty,
)
class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):

View File

@ -21,7 +21,10 @@
import bpy
from bpy.types import Operator
from bpy.props import EnumProperty, IntProperty
from bpy.props import (
EnumProperty,
IntProperty,
)
class MeshMirrorUV(Operator):
@ -254,4 +257,4 @@ classes = (
MeshMirrorUV,
MeshSelectNext,
MeshSelectPrev,
)
)

View File

@ -21,16 +21,16 @@
import bpy
import nodeitems_utils
from bpy.types import (
Operator,
PropertyGroup,
)
Operator,
PropertyGroup,
)
from bpy.props import (
BoolProperty,
CollectionProperty,
EnumProperty,
IntProperty,
StringProperty,
)
BoolProperty,
CollectionProperty,
EnumProperty,
IntProperty,
StringProperty,
)
class NodeSetting(PropertyGroup):

View File

@ -21,12 +21,12 @@
import bpy
from bpy.types import Operator
from bpy.props import (
StringProperty,
BoolProperty,
EnumProperty,
IntProperty,
FloatProperty,
)
BoolProperty,
EnumProperty,
FloatProperty,
IntProperty,
StringProperty,
)
class SelectPattern(Operator):
@ -1052,4 +1052,4 @@ classes = (
SubdivisionSet,
TransformsToDeltas,
TransformsToDeltasAnim,
)
)

View File

@ -26,13 +26,14 @@ from mathutils import Vector
def GlobalBB_LQ(bb_world):
# Initialize the variables with the 8th vertex
left, right, front, back, down, up = (bb_world[7][0],
bb_world[7][0],
bb_world[7][1],
bb_world[7][1],
bb_world[7][2],
bb_world[7][2],
)
left, right, front, back, down, up = (
bb_world[7][0],
bb_world[7][0],
bb_world[7][1],
bb_world[7][1],
bb_world[7][2],
bb_world[7][2],
)
# Test against the other 7 verts
for i in range(7):
@ -398,13 +399,15 @@ class AlignObjects(Operator):
def execute(self, context):
align_axis = self.align_axis
ret = align_objects(context,
'X' in align_axis,
'Y' in align_axis,
'Z' in align_axis,
self.align_mode,
self.relative_to,
self.bb_quality)
ret = align_objects(
context,
'X' in align_axis,
'Y' in align_axis,
'Z' in align_axis,
self.align_mode,
self.relative_to,
self.bb_quality,
)
if not ret:
self.report({'WARNING'}, "No objects with bound-box selected")
@ -415,4 +418,4 @@ class AlignObjects(Operator):
classes = (
AlignObjects,
)
)

View File

@ -22,12 +22,12 @@ from mathutils import Vector
import bpy
from bpy.types import Operator
from bpy.props import (
BoolProperty,
EnumProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
)
BoolProperty,
EnumProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
)
def object_ensure_material(obj, mat_name):
@ -652,4 +652,4 @@ classes = (
QuickFluid,
QuickFur,
QuickSmoke,
)
)

View File

@ -20,8 +20,10 @@
import bpy
from bpy.types import Operator
from bpy.props import IntProperty
from bpy.props import EnumProperty
from bpy.props import (
EnumProperty,
IntProperty,
)
class CopyRigidbodySettings(Operator):
@ -315,4 +317,4 @@ classes = (
BakeToKeyframes,
ConnectRigidBodies,
CopyRigidbodySettings,
)
)

View File

@ -18,7 +18,11 @@
# TODO <pep8 compliant>
from mathutils import Matrix, Vector, geometry
from mathutils import (
Matrix,
Vector,
geometry,
)
import bpy
from bpy.types import Operator
@ -1104,4 +1108,4 @@ class SmartProject(Operator):
classes = (
SmartProject,
)
)

View File

@ -21,12 +21,12 @@
import bpy
from bpy.types import Operator
from bpy.props import (
StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
EnumProperty,
)
StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
EnumProperty,
)
from bpy.app.translations import pgettext_tip as tip_
@ -921,7 +921,10 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
# an operator (common case - just button referencing an op)
if hasattr(bpy.types, class_name.upper() + "_OT_" + class_prop):
if do_url:
url = ("%s/bpy.ops.%s.html#bpy.ops.%s.%s" % (url_prefix, class_name, class_name, class_prop))
url = (
"%s/bpy.ops.%s.html#bpy.ops.%s.%s" %
(url_prefix, class_name, class_name, class_prop)
)
else:
rna = "bpy.ops.%s.%s" % (class_name, class_prop)
else:
@ -936,7 +939,10 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
class_name, class_prop = class_name.split("_OT_", 1)
class_name = class_name.lower()
if do_url:
url = ("%s/bpy.ops.%s.html#bpy.ops.%s.%s" % (url_prefix, class_name, class_name, class_prop))
url = (
"%s/bpy.ops.%s.html#bpy.ops.%s.%s" %
(url_prefix, class_name, class_name, class_prop)
)
else:
rna = "bpy.ops.%s.%s" % (class_name, class_prop)
else:
@ -952,9 +958,12 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
rna_parent = rna_parent.base
if do_url:
url = ("%s/bpy.types.%s.html#bpy.types.%s.%s" % (url_prefix, class_name, class_name, class_prop))
url = (
"%s/bpy.types.%s.html#bpy.types.%s.%s" %
(url_prefix, class_name, class_name, class_prop)
)
else:
rna = ("bpy.types.%s.%s" % (class_name, class_prop))
rna = "bpy.types.%s.%s" % (class_name, class_prop)
else:
# We assume this is custom property, only try to generate generic url/rna_id...
if do_url:
@ -1101,10 +1110,10 @@ class WM_OT_properties_edit(Operator):
def execute(self, context):
from rna_prop_ui import (
rna_idprop_ui_prop_get,
rna_idprop_ui_prop_clear,
rna_idprop_ui_prop_update,
)
rna_idprop_ui_prop_get,
rna_idprop_ui_prop_clear,
rna_idprop_ui_prop_update,
)
data_path = self.data_path
value = self.value
@ -1281,9 +1290,9 @@ class WM_OT_properties_add(Operator):
def execute(self, context):
from rna_prop_ui import (
rna_idprop_ui_prop_get,
rna_idprop_ui_prop_update,
)
rna_idprop_ui_prop_get,
rna_idprop_ui_prop_update,
)
data_path = self.data_path
item = eval("context.%s" % data_path)
@ -1298,10 +1307,10 @@ class WM_OT_properties_add(Operator):
return prop_new
prop = unique_name(
{*item.keys(),
*type(item).bl_rna.properties.keys(),
})
prop = unique_name({
*item.keys(),
*type(item).bl_rna.properties.keys(),
})
item[prop] = 1.0
rna_idprop_ui_prop_update(item, prop)
@ -1341,9 +1350,9 @@ class WM_OT_properties_remove(Operator):
def execute(self, context):
from rna_prop_ui import (
rna_idprop_ui_prop_clear,
rna_idprop_ui_prop_update,
)
rna_idprop_ui_prop_clear,
rna_idprop_ui_prop_update,
)
data_path = self.data_path
item = eval("context.%s" % data_path)
prop = self.property
@ -1381,7 +1390,10 @@ class WM_OT_appconfig_default(Operator):
filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py")
if os.path.exists(filepath):
bpy.ops.script.execute_preset(filepath=filepath, menu_idname="USERPREF_MT_interaction_presets")
bpy.ops.script.execute_preset(
filepath=filepath,
menu_idname="USERPREF_MT_interaction_presets",
)
return {'FINISHED'}
@ -1401,7 +1413,10 @@ class WM_OT_appconfig_activate(Operator):
filepath = self.filepath.replace("keyconfig", "interaction")
if os.path.exists(filepath):
bpy.ops.script.execute_preset(filepath=filepath, menu_idname="USERPREF_MT_interaction_presets")
bpy.ops.script.execute_preset(
filepath=filepath,
menu_idname="USERPREF_MT_interaction_presets",
)
return {'FINISHED'}
@ -1506,7 +1521,7 @@ class WM_OT_blenderplayer_start(Operator):
"-g", "show_profile", "=", "%d" % gs.show_framerate_profile,
"-g", "show_properties", "=", "%d" % gs.show_debug_properties,
"-g", "ignore_deprecation_warnings", "=", "%d" % (not gs.use_deprecation_warnings),
])
])
# finish the call with the path to the blend file
args.append(filepath)
@ -1636,10 +1651,11 @@ class WM_OT_keyconfig_export(Operator):
wm = context.window_manager
keyconfig_utils.keyconfig_export(wm,
wm.keyconfigs.active,
self.filepath,
)
keyconfig_utils.keyconfig_export(
wm,
wm.keyconfigs.active,
self.filepath,
)
return {'FINISHED'}
@ -1904,7 +1920,10 @@ class WM_OT_theme_install(Operator):
try:
shutil.copyfile(xmlfile, path_dest)
bpy.ops.script.execute_preset(filepath=path_dest, menu_idname="USERPREF_MT_interface_theme_presets")
bpy.ops.script.execute_preset(
filepath=path_dest,
menu_idname="USERPREF_MT_interface_theme_presets",
)
except:
traceback.print_exc()
@ -2232,7 +2251,6 @@ class WM_OT_app_template_install(Operator):
)
def execute(self, context):
import addon_utils
import traceback
import zipfile
import shutil

View File

@ -19,7 +19,11 @@
# <pep8 compliant>
import bpy
import nodeitems_utils
from nodeitems_utils import NodeCategory, NodeItem, NodeItemCustom
from nodeitems_utils import (
NodeCategory,
NodeItem,
NodeItemCustom,
)
# Subclasses for standard node types