From 9f7b85372dd205ff15346f32c3e0d8f1dbebded1 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 24 Sep 2018 13:57:26 +0200 Subject: [PATCH] Fix #142 - allow to ignore menu install on missing "scriptsmenu" dependency --- colorbleed/maya/menu.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/colorbleed/maya/menu.py b/colorbleed/maya/menu.py index 1e411e1c78..9223271d65 100644 --- a/colorbleed/maya/menu.py +++ b/colorbleed/maya/menu.py @@ -23,10 +23,15 @@ def _get_menu(): def deferred(): - import scriptsmenu.launchformaya as launchformaya - import scriptsmenu.scriptsmenu as scriptsmenu + log.info("Attempting to install scripts menu..") - log.info("Attempting to install ...") + try: + import scriptsmenu.launchformaya as launchformaya + import scriptsmenu.scriptsmenu as scriptsmenu + except ImportError: + log.warning("Skipping colorbleed.menu install, because " + "'scriptsmenu' module seems unavailable.") + return # load configuration of custom menu config_path = os.path.join(os.path.dirname(__file__), "menu.json") @@ -44,7 +49,7 @@ def uninstall(): menu = _get_menu() if menu: - log.info("Attempting to uninstall ..") + log.info("Attempting to uninstall..") try: menu.deleteLater()