From 99e400e87ae28e6366fabc1ec901b3e0563f3bfc Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 1 Jun 2017 12:07:46 -0300 Subject: [PATCH] Addon manager: Added check for optional py dependencies --- src/Mod/AddonManager/AddonManager.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Mod/AddonManager/AddonManager.py b/src/Mod/AddonManager/AddonManager.py index 1ff681d182..77076cc90f 100644 --- a/src/Mod/AddonManager/AddonManager.py +++ b/src/Mod/AddonManager/AddonManager.py @@ -617,7 +617,15 @@ class InstallWorker(QtCore.QThread): except: ok = False message += translate("AddonsInstaller","Missing python module") +": " + pl + ", " - if message: + elif l.startswith("optionalpylibs="): + opspy = l.split("=")[1].split(",") + for pl in opspy: + if pl.strip(): + try: + __import__(pl.strip()) + except: + message += translate("AddonsInstaller","Missing optional python module (doesn't prevent installing)") +": " + pl + ", " + if message and (not ok): message = translate("AddonsInstaller", "Some errors were found that prevent to install this workbench") + ": " + message + ". " message += translate("AddonsInstaller","Please install the missing components first.") return ok, message