[Bf-extensions-cvs] [b39a0d51] blender2.8: Cleanup: style

Campbell Barton noreply at git.blender.org
Tue Oct 30 05:37:49 CET 2018


Commit: b39a0d519871844f74be12cbeff31e4a6edb6e41
Author: Campbell Barton
Date:   Mon Oct 29 18:33:38 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBAb39a0d519871844f74be12cbeff31e4a6edb6e41

Cleanup: style

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

M	system_demo_mode/__init__.py
M	system_demo_mode/config.py
M	system_demo_mode/demo_mode.py

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

diff --git a/system_demo_mode/__init__.py b/system_demo_mode/__init__.py
index 75eb38ba..b07da919 100644
--- a/system_demo_mode/__init__.py
+++ b/system_demo_mode/__init__.py
@@ -28,7 +28,8 @@ bl_info = {
     "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
                 "Scripts/System/Demo_Mode#Running_Demo_Mode",
     "support": 'OFFICIAL',
-    "category": "System"}
+    "category": "System",
+}
 
 # To support reload properly, try to access a package var, if it's there, reload everything
 if "bpy" in locals():
@@ -70,9 +71,11 @@ class DemoModeSetup(bpy.types.Operator):
     )
     mode: EnumProperty(
         name="Method",
-        items=(('AUTO', "Auto", ""),
-               ('PLAY', "Play", ""),
-               ('RENDER', "Render", ""))
+        items=(
+            ('AUTO', "Auto", ""),
+            ('PLAY', "Play", ""),
+            ('RENDER', "Render", ""),
+        )
     )
 
     run: BoolProperty(
@@ -243,9 +246,15 @@ def menu_func(self, context):
     layout.separator()
 
 
+classes = (
+    DemoModeSetup,
+    DemoModeRun,
+)
+
 def register():
-    bpy.utils.register_class(DemoModeSetup)
-    bpy.utils.register_class(DemoModeRun)
+    from bpy.utils import register_class
+    for cls in classes:
+        register_class(cls)
 
     bpy.types.TOPBAR_MT_file.prepend(menu_func)
 
@@ -253,8 +262,9 @@ def register():
 
 
 def unregister():
-    bpy.utils.unregister_class(DemoModeSetup)
-    bpy.utils.unregister_class(DemoModeRun)
+    from bpy.utils import unregister_class
+    for cls in classes:
+        unregister_class(cls)
 
     bpy.types.TOPBAR_MT_file.remove(menu_func)
 
diff --git a/system_demo_mode/config.py b/system_demo_mode/config.py
index 24e25be5..b3a7aad4 100644
--- a/system_demo_mode/config.py
+++ b/system_demo_mode/config.py
@@ -65,7 +65,7 @@ def as_string(dirpath, random_order, exit, **kwargs):
         "\n",
         "exit = %r\n" % exit,
         "\n",
-        ]
+    ]
 
     # All these work but use nicest formatting!
     if 0:  # works but not nice to edit.
diff --git a/system_demo_mode/demo_mode.py b/system_demo_mode/demo_mode.py
index 1a717a5e..b365fdfc 100644
--- a/system_demo_mode/demo_mode.py
+++ b/system_demo_mode/demo_mode.py
@@ -44,23 +44,26 @@ DEMO_CFG = "demo.py"
 # populate from script
 global_config_files = []
 
-global_config = dict(anim_cycles=1,
-                     anim_render=False,
-                     anim_screen_switch=0.0,
-                     anim_time_max=60.0,
-                     anim_time_min=4.0,
-                     mode='AUTO',
-                     display_render=4.0)
+global_config = dict(
+    anim_cycles=1,
+    anim_render=False,
+    anim_screen_switch=0.0,
+    anim_time_max=60.0,
+    anim_time_min=4.0,
+    mode='AUTO',
+    display_render=4.0,
+)
 
 # switch to the next file in 2 sec.
-global_config_fallback = dict(anim_cycles=1,
-                              anim_render=False,
-                              anim_screen_switch=0.0,
-                              anim_time_max=60.0,
-                              anim_time_min=4.0,
-                              mode='AUTO',
-                              display_render=4.0)
-
+global_config_fallback = dict(
+    anim_cycles=1,
+    anim_render=False,
+    anim_screen_switch=0.0,
+    anim_time_max=60.0,
+    anim_time_min=4.0,
+    mode='AUTO',
+    display_render=4.0,
+)
 
 global_state = {
     "init_time": 0.0,
@@ -253,9 +256,10 @@ def demo_mode_update():
             demo_mode_next_file()
             return
         # above cycles and minimum display time
-        if  (time_total > global_config["anim_time_min"]) and \
-            (global_state["anim_cycles"] > global_config["anim_cycles"]):
-
+        if (
+                (time_total > global_config["anim_time_min"]) and
+                (global_state["anim_cycles"] > global_config["anim_cycles"])
+        ):
             # looped enough now.
             demo_mode_next_file()
             return



More information about the Bf-extensions-cvs mailing list