[Bf-extensions-cvs] [6f0881b] master: Cleanup: list submodules once

Campbell Barton noreply at git.blender.org
Tue Jul 26 09:48:18 CEST 2016


Commit: 6f0881bcf185fd1028f222de029a40e0bd166a57
Author: Campbell Barton
Date:   Tue Jul 26 17:47:56 2016 +1000
Branches: master
https://developer.blender.org/rBAC6f0881bcf185fd1028f222de029a40e0bd166a57

Cleanup: list submodules once

Also add license headers

===================================================================

M	space_view3d_pie_menus/__init__.py
M	space_view3d_pie_menus/pie_align_menu/__init__.py
M	space_view3d_pie_menus/pie_animation_menu/__init__.py
M	space_view3d_pie_menus/pie_apply_transform_menu/__init__.py
M	space_view3d_pie_menus/pie_delete_menu/__init__.py
M	space_view3d_pie_menus/pie_editor_switch_menu/__init__.py
M	space_view3d_pie_menus/pie_manipulator_menu/__init__.py
M	space_view3d_pie_menus/pie_modes_menu/__init__.py
M	space_view3d_pie_menus/pie_orientation_menu/__init__.py
M	space_view3d_pie_menus/pie_origin_cursor/__init__.py
M	space_view3d_pie_menus/pie_pivot_point_menu/__init__.py
M	space_view3d_pie_menus/pie_proportional_menu/__init__.py
M	space_view3d_pie_menus/pie_save_open_menu/__init__.py
M	space_view3d_pie_menus/pie_sculpt_menu/__init__.py
M	space_view3d_pie_menus/pie_select_menu/__init__.py
M	space_view3d_pie_menus/pie_shading_menu/__init__.py
M	space_view3d_pie_menus/pie_snap_menu/__init__.py
M	space_view3d_pie_menus/pie_views_numpad_menu/__init__.py
M	space_view3d_pie_menus/utils.py

===================================================================

diff --git a/space_view3d_pie_menus/__init__.py b/space_view3d_pie_menus/__init__.py
index 7af91c1..79c6e94 100644
--- a/space_view3d_pie_menus/__init__.py
+++ b/space_view3d_pie_menus/__init__.py
@@ -43,48 +43,29 @@ from bpy.types import (
         AddonPreferences,
         )
 
-from . import pie_modes_menu
-from . import pie_views_numpad_menu
-from . import pie_sculpt_menu
-from . import pie_origin_cursor
-from . import pie_manipulator_menu
-from . import pie_snap_menu
-from . import pie_orientation_menu
-from . import pie_shading_menu
-from . import pie_pivot_point_menu
-from . import pie_proportional_menu
-from . import pie_align_menu
-from . import pie_delete_menu
-from . import pie_apply_transform_menu
-from . import pie_select_menu
-from . import pie_animation_menu
-from . import pie_save_open_menu
-from . import pie_editor_switch_menu
-
-
-sub_modules = [
-    pie_modes_menu,
-    pie_views_numpad_menu,
-    pie_sculpt_menu,
-    pie_origin_cursor,
-    pie_manipulator_menu,
-    pie_snap_menu,
-    pie_orientation_menu,
-    pie_shading_menu,
-    pie_pivot_point_menu,
-    pie_proportional_menu,
-    pie_align_menu,
-    pie_delete_menu,
-    pie_apply_transform_menu,
-    pie_select_menu,
-    pie_animation_menu,
-    pie_save_open_menu,
-    pie_editor_switch_menu,
-    ]
-
-
-sub_modules.sort(
-    key=lambda mod: (mod.bl_info['category'], mod.bl_info['name']))
+sub_modules_names = (
+    "pie_modes_menu",
+    "pie_views_numpad_menu",
+    "pie_sculpt_menu",
+    "pie_origin_cursor",
+    "pie_manipulator_menu",
+    "pie_snap_menu",
+    "pie_orientation_menu",
+    "pie_shading_menu",
+    "pie_pivot_point_menu",
+    "pie_proportional_menu",
+    "pie_align_menu",
+    "pie_delete_menu",
+    "pie_apply_transform_menu",
+    "pie_select_menu",
+    "pie_animation_menu",
+    "pie_save_open_menu",
+    "pie_editor_switch_menu",
+    )
+
+
+sub_modules = [__import__(__package__ + "." + submod, {}, {}, submod) for submod in sub_modules_names]
+sub_modules.sort(key=lambda mod: (mod.bl_info['category'], mod.bl_info['name']))
 
 
 def _get_pref_class(mod):
@@ -262,9 +243,9 @@ for mod in sub_modules:
     prop = BoolProperty()
     setattr(UIToolsPreferences, 'show_expanded_' + mod_name, prop)
 
-classes = [
+classes = (
     UIToolsPreferences,
-]
+    )
 
 
 def register():
@@ -285,7 +266,7 @@ def unregister():
         if mod.__addon_enabled__:
             unregister_submodule(mod)
 
-    for cls in classes[::-1]:
+    for cls in reversed(classes):
         bpy.utils.unregister_class(cls)
 
 if __name__ == "__main__":
diff --git a/space_view3d_pie_menus/pie_align_menu/__init__.py b/space_view3d_pie_menus/pie_align_menu/__init__.py
index c42a6d6..a20665e 100644
--- a/space_view3d_pie_menus/pie_align_menu/__init__.py
+++ b/space_view3d_pie_menus/pie_align_menu/__init__.py
@@ -1,3 +1,22 @@
+# ##### 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
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
 
 bl_info = {
     "name": "Hotkey: 'Alt X'",
@@ -351,7 +370,7 @@ class AlignZBottom(bpy.types.Operator):
         bpy.ops.object.mode_set(mode='EDIT')
         return {'FINISHED'}
 
-classes = [
+classes = (
     PieAlign,
     AlignX,
     AlignY,
@@ -365,7 +384,7 @@ classes = [
     AlignYFront,
     AlignZTop,
     AlignZBottom,
-    ]
+    )
 
 addon_keymaps = []
 
diff --git a/space_view3d_pie_menus/pie_animation_menu/__init__.py b/space_view3d_pie_menus/pie_animation_menu/__init__.py
index 41d34cf..6f74461 100644
--- a/space_view3d_pie_menus/pie_animation_menu/__init__.py
+++ b/space_view3d_pie_menus/pie_animation_menu/__init__.py
@@ -1,3 +1,22 @@
+# ##### 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
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
 
 bl_info = {
     "name": "Hotkey: 'Alt A'",
@@ -67,10 +86,10 @@ class InsertAutoKeyframe(bpy.types.Operator):
 
         return {'FINISHED'}
 
-classes = [
+classes = (
     PieAnimation,
     InsertAutoKeyframe
-    ]
+    )
 
 addon_keymaps = []
 
diff --git a/space_view3d_pie_menus/pie_apply_transform_menu/__init__.py b/space_view3d_pie_menus/pie_apply_transform_menu/__init__.py
index af2dfe8..f87795c 100644
--- a/space_view3d_pie_menus/pie_apply_transform_menu/__init__.py
+++ b/space_view3d_pie_menus/pie_apply_transform_menu/__init__.py
@@ -1,3 +1,22 @@
+# ##### 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
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
 
 bl_info = {
     "name": "Hotkey: 'Ctrl A'",
@@ -147,7 +166,7 @@ class ClearAll(bpy.types.Operator):
         bpy.ops.object.scale_clear()
         return {'FINISHED'}
 
-classes = [
+classes = (
     PieApplyTransforms,
     ApplyTransformLocation,
     ApplyTransformRotation,
@@ -157,7 +176,7 @@ classes = [
     ClearMenu,
     ClearAll,
     TransformApplyMore,
-    ]
+    )
 
 addon_keymaps = []
 
diff --git a/space_view3d_pie_menus/pie_delete_menu/__init__.py b/space_view3d_pie_menus/pie_delete_menu/__init__.py
index f5d1590..9e02c13 100644
--- a/space_view3d_pie_menus/pie_delete_menu/__init__.py
+++ b/space_view3d_pie_menus/pie_delete_menu/__init__.py
@@ -1,3 +1,22 @@
+# ##### 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
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
 
 bl_info = {
     "name": "Hotkey: 'X'",
@@ -61,10 +80,10 @@ class DeleteLimitedDissolve(bpy.types.Operator):
         bpy.ops.mesh.dissolve_limited
         return {'FINISHED'}
 
-classes = [
+classes = (
     PieDelete,
     DeleteLimitedDissolve,
-    ]
+    )
 
 addon_keymaps = []
 
diff --git a/space_view3d_pie_menus/pie_editor_switch_menu/__init__.py b/space_view3d_pie_menus/pie_editor_switch_menu/__init__.py
index b05193d..da1910c 100644
--- a/space_view3d_pie_menus/pie_editor_switch_menu/__init__.py
+++ b/space_view3d_pie_menus/pie_editor_switch_menu/__init__.py
@@ -1,3 +1,22 @@
+# ##### 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
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
 
 bl_info = {
     "name": "Hotkey: 'Ctrl Alt S ",
@@ -118,14 +137,14 @@ class AreaTypePieAnim(bpy.types.Menu):
         self.layout.menu_pie().operator("wm.call_menu_pie", text="Back", icon="BACK").name = PieEditor.bl_idname
         # 3 - BOTTOM - RIGHT
 
-classes = [
+classes = (
     AreaPieMenu,
     AreaTypePieOperator,
     AreaPieEditor,
     AreaTypePieOther,
     SetAreaType,
     AreaTypePieAnim,
-    ]
+    )
 
 addon_keymaps = []
 
diff --git a/space_view3d_pie_menus/pie_manipulator_menu/__init__.py b/space_view3d_pie_menus/pie_manipulator_menu/__init__.py
index c22bd7b..5e48f86 100644
--- a/space_view3d_pie_menus/pie_manipulator_menu/__init__.py
+++ b/space_view3d_pie_menus/pie_manipul

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list