[Bf-blender-cvs] [5f2f80d143] app-templates: Cleanup: cruft

Campbell Barton noreply at git.blender.org
Thu Mar 23 21:33:12 CET 2017


Commit: 5f2f80d1437f96c4e52d3def1a7b0e7fca8f85eb
Author: Campbell Barton
Date:   Fri Mar 24 07:33:33 2017 +1100
Branches: app-templates
https://developer.blender.org/rB5f2f80d1437f96c4e52d3def1a7b0e7fca8f85eb

Cleanup: cruft

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

M	release/scripts/modules/bl_app_template_utils.py

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

diff --git a/release/scripts/modules/bl_app_template_utils.py b/release/scripts/modules/bl_app_template_utils.py
index 834280cb75..5f490f6156 100644
--- a/release/scripts/modules/bl_app_template_utils.py
+++ b/release/scripts/modules/bl_app_template_utils.py
@@ -25,17 +25,10 @@ In most cases users of this module will simply call 'activate'.
 """
 
 __all__ = (
-    # "paths",
-    # "modules",
-    # "check",
-    # "enable",
-    # "disable",
-
     "activate",
     "import_from_path",
     "import_from_id",
     "reset",
-    # "module_bl_info",
 )
 
 import bpy as _bpy
@@ -113,7 +106,8 @@ def _disable(template_id, *, handle_error=None):
 
     :arg template_id: The name of the template and module.
     :type template_id: string
-    :arg handle_error: Called in the case of an error, taking an exception argument.
+    :arg handle_error: Called in the case of an error,
+       taking an exception argument.
     :type handle_error: function
     """
     import sys
@@ -125,9 +119,6 @@ def _disable(template_id, *, handle_error=None):
 
     mod = _modules.get(template_id)
 
-    # possible this addon is from a previous session and didn't load a
-    # module this time. So even if the module is not found, still disable
-    # the addon in the user prefs.
     if mod and getattr(mod, "__template_enabled__", False) is not False:
         mod.__template_enabled__ = False
 
@@ -206,18 +197,6 @@ def reset(*, reload_scripts=False):
     if _bpy.app.debug_python:
         print("bl_app_template_utils.reset('%s')" % template_id)
 
-    if reload_scripts and False:
-        # TODO, seems correct but reload fails
-        import importlib
-        import os
-        import sys
-        _modules_new = {}
-        for key, mod in _modules.items():
-            # Will always be 'template' but just use convention of __name__ to be sure.
-            module_name = mod.__name__
-            _modules_new[key] = importlib.reload(mod)
-        _modules.clear()
-        _modules.update(_modules_new)
-        del _modules_new
+    # TODO reload_scripts
 
     activate(template_id)




More information about the Bf-blender-cvs mailing list