From ad7fb1c028433621a9f71ab01bbda2ca827ffe74 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Nov 2017 18:00:41 +1100 Subject: Cleanup: Python imports Split over lines to diff more easily. --- release/scripts/modules/bl_i18n_utils/merge_po.py | 6 +++--- .../scripts/modules/bl_previews_utils/bl_previews_render.py | 8 ++++++-- release/scripts/modules/bpy/__init__.py | 13 +++++++++++-- release/scripts/modules/bpy_extras/io_utils.py | 8 ++++---- release/scripts/modules/bpy_extras/object_utils.py | 8 ++++---- release/scripts/modules/bpyml_ui.py | 8 ++++++-- release/scripts/startup/bl_operators/add_mesh_torus.py | 10 +++++----- release/scripts/startup/bl_operators/console.py | 8 ++++---- release/scripts/startup/bl_operators/file.py | 10 +++++----- release/scripts/startup/bl_operators/object_align.py | 7 ++++--- .../scripts/startup/bl_operators/object_quick_effects.py | 2 +- .../startup/bl_operators/object_randomize_transform.py | 10 ++++++---- release/scripts/startup/bl_operators/wm.py | 6 +++--- release/scripts/templates_py/operator_mesh_add.py | 10 +++++----- 14 files changed, 67 insertions(+), 47 deletions(-) diff --git a/release/scripts/modules/bl_i18n_utils/merge_po.py b/release/scripts/modules/bl_i18n_utils/merge_po.py index 2fda42199bb..ecb26123999 100755 --- a/release/scripts/modules/bl_i18n_utils/merge_po.py +++ b/release/scripts/modules/bl_i18n_utils/merge_po.py @@ -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! diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py index 71208ef3485..32266e972bb 100644 --- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py +++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py @@ -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: diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 545b891505f..6312c25065f 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -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 diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index a7ecd0b80c0..8a516f12b17 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -36,10 +36,10 @@ __all__ = ( import bpy from bpy.props import ( - StringProperty, - BoolProperty, - EnumProperty, - ) + BoolProperty, + EnumProperty, + StringProperty, +) def _check_axis_conversion(op): diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index c48f03c133d..9d9b5df1f9a 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -32,10 +32,10 @@ __all__ = ( import bpy from bpy.props import ( - BoolProperty, - BoolVectorProperty, - FloatVectorProperty, - ) + BoolProperty, + BoolVectorProperty, + FloatVectorProperty, +) def add_object_align_init(context, operator): diff --git a/release/scripts/modules/bpyml_ui.py b/release/scripts/modules/bpyml_ui.py index dd5fc38d0eb..1ba89ad098b 100644 --- a/release/scripts/modules/bpyml_ui.py +++ b/release/scripts/modules/bpyml_ui.py @@ -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 * diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py index 0e5acea94f9..c4fefaed06d 100644 --- a/release/scripts/startup/bl_operators/add_mesh_torus.py +++ b/release/scripts/startup/bl_operators/add_mesh_torus.py @@ -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, -) \ No newline at end of file +) diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py index fb36f80239e..0025967c97c 100644 --- a/release/scripts/startup/bl_operators/console.py +++ b/release/scripts/startup/bl_operators/console.py @@ -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, -) \ No newline at end of file +) diff --git a/release/scripts/startup/bl_operators/file.py b/release/scripts/startup/bl_operators/file.py index d710b9af715..1b51906a032 100644 --- a/release/scripts/startup/bl_operators/file.py +++ b/release/scripts/startup/bl_operators/file.py @@ -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, -) \ No newline at end of file +) diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py index b7d3866989d..a4e601dc7d1 100644 --- a/release/scripts/startup/bl_operators/object_align.py +++ b/release/scripts/startup/bl_operators/object_align.py @@ -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): diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 16f29c77bb9..6b9442769af 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -24,9 +24,9 @@ from bpy.types import Operator from bpy.props import ( BoolProperty, EnumProperty, - IntProperty, FloatProperty, FloatVectorProperty, + IntProperty, ) diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py index f856b85844e..a91e1a5b031 100644 --- a/release/scripts/startup/bl_operators/object_randomize_transform.py +++ b/release/scripts/startup/bl_operators/object_randomize_transform.py @@ -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, -) \ No newline at end of file +) diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 20586b727d5..f1f32233a42 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -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_ diff --git a/release/scripts/templates_py/operator_mesh_add.py b/release/scripts/templates_py/operator_mesh_add.py index 2590d53e49a..3231214c773 100644 --- a/release/scripts/templates_py/operator_mesh_add.py +++ b/release/scripts/templates_py/operator_mesh_add.py @@ -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): -- cgit v1.2.3