Cleanup: Python imports

Split over lines to diff more easily.
This commit is contained in:
Campbell Barton
2017-11-29 18:00:41 +11:00
parent c17c6557b4
commit ad7fb1c028
14 changed files with 67 additions and 47 deletions

View File

@@ -35,9 +35,9 @@ if __package__ is None:
import utils
else:
from . import (
settings,
utils,
)
settings,
utils,
)
# XXX This is a quick hack to make it work with new I18n... objects! To be reworked!

View File

@@ -24,7 +24,11 @@
import os
import bpy
from mathutils import Vector, Euler, Matrix
from mathutils import (
Euler,
Matrix,
Vector,
)
INTERN_PREVIEW_TYPES = {'MATERIAL', 'LAMP', 'WORLD', 'TEXTURE', 'IMAGE'}
@@ -39,7 +43,7 @@ def rna_backup_gen(data, include_props=None, exclude_props=None, root=()):
# only writable properties...
for p in data.bl_rna.properties:
pid = p.identifier
if pid in {'rna_type', }:
if pid == "rna_type":
continue
path = root + (pid,)
if include_props is not None and path not in include_props:

View File

@@ -35,10 +35,19 @@ __all__ = (
# internal blender C module
from _bpy import types, props, app, data, context
from _bpy import (
app,
context,
data,
props,
types,
)
# python modules
from . import utils, path
from . import (
path,
utils,
)
# fake operator module
from .ops import ops_fake_module as ops

View File

@@ -36,10 +36,10 @@ __all__ = (
import bpy
from bpy.props import (
StringProperty,
BoolProperty,
EnumProperty,
)
BoolProperty,
EnumProperty,
StringProperty,
)
def _check_axis_conversion(op):

View File

@@ -32,10 +32,10 @@ __all__ = (
import bpy
from bpy.props import (
BoolProperty,
BoolVectorProperty,
FloatVectorProperty,
)
BoolProperty,
BoolVectorProperty,
FloatVectorProperty,
)
def add_object_align_init(context, operator):

View File

@@ -21,7 +21,11 @@
import bpy as _bpy
import bpyml
from bpyml import TAG, ARGS, CHILDREN
from bpyml import (
TAG,
ARGS,
CHILDREN,
)
_uilayout_rna = _bpy.types.UILayout.bl_rna
@@ -29,7 +33,7 @@ _uilayout_tags = (
["ui"] +
_uilayout_rna.properties.keys() +
_uilayout_rna.functions.keys()
)
)
# these need to be imported directly
# >>> from bpyml_ui.locals import *

View File

@@ -21,10 +21,10 @@ import bpy
from bpy.types import Operator
from bpy.props import (
FloatProperty,
IntProperty,
BoolProperty,
)
BoolProperty,
FloatProperty,
IntProperty,
)
from bpy.app.translations import pgettext_data as data_
from bpy_extras import object_utils
@@ -286,4 +286,4 @@ class AddTorus(Operator, object_utils.AddObjectHelper):
classes = (
AddTorus,
)
)

View File

@@ -21,9 +21,9 @@
import bpy
from bpy.types import Operator
from bpy.props import (
BoolProperty,
StringProperty,
)
BoolProperty,
StringProperty,
)
def _lang_module_get(sc):
@@ -167,4 +167,4 @@ classes = (
ConsoleCopyAsScript,
ConsoleExec,
ConsoleLanguage,
)
)

View File

@@ -21,10 +21,10 @@
import bpy
from bpy.types import Operator
from bpy.props import (
StringProperty,
BoolProperty,
CollectionProperty,
)
BoolProperty,
CollectionProperty,
StringProperty,
)
# ########## Datablock previews... ##########
@@ -252,4 +252,4 @@ class WM_OT_previews_batch_clear(Operator):
classes = (
WM_OT_previews_batch_clear,
WM_OT_previews_batch_generate,
)
)

View File

@@ -1,4 +1,5 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -351,9 +352,9 @@ def align_objects(context,
from bpy.props import (
EnumProperty,
BoolProperty
)
BoolProperty,
EnumProperty,
)
class AlignObjects(Operator):

View File

@@ -24,9 +24,9 @@ from bpy.types import Operator
from bpy.props import (
BoolProperty,
EnumProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
IntProperty,
)

View File

@@ -90,9 +90,11 @@ def randomize_selected(context, seed, delta,
uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0)
from bpy.props import (IntProperty,
BoolProperty,
FloatVectorProperty)
from bpy.props import (
BoolProperty,
FloatVectorProperty,
IntProperty,
)
class RandomizeLocRotSize(Operator):
@@ -189,4 +191,4 @@ class RandomizeLocRotSize(Operator):
classes = (
RandomizeLocRotSize,
)
)

View File

@@ -21,11 +21,11 @@
import bpy
from bpy.types import Operator
from bpy.props import (
StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
EnumProperty,
FloatProperty,
IntProperty,
StringProperty,
)
from bpy.app.translations import pgettext_tip as tip_

View File

@@ -34,11 +34,11 @@ def add_box(width, height, depth):
from bpy.props import (
BoolProperty,
BoolVectorProperty,
FloatProperty,
FloatVectorProperty,
)
BoolProperty,
BoolVectorProperty,
FloatProperty,
FloatVectorProperty,
)
class AddBox(bpy.types.Operator):