diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-23 21:20:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-23 21:20:26 +0300 |
commit | 9af6f40e4dcf0dc6e95a809ed0998bbdb8189a86 (patch) | |
tree | 42944c47de0e89e42196ef5021165cec669defd4 | |
parent | a96110e7102d7a54127994b81c8c049f6e5fdeea (diff) |
addon_utils: add disable_all function
-rw-r--r-- | release/scripts/modules/addon_utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index 886f078f046..51e3e65b78c 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -24,6 +24,7 @@ __all__ = ( "check", "enable", "disable", + "disable_all", "reset_all", "module_bl_info", ) @@ -444,6 +445,13 @@ def reset_all(*, reload_scripts=False): disable(mod_name) +def disable_all(): + import sys + for mod_name, mod in sys.modules.items(): + if getattr(mod, "__addon_enabled__", False): + disable(mod_name) + + def module_bl_info(mod, info_basis=None): if info_basis is None: info_basis = { |