Improve warning on solver backend not found

This commit is contained in:
Zheng, Lei 2018-04-20 14:14:01 +08:00
parent 287642d34a
commit f9ed2eb880

View File

@ -4,11 +4,14 @@ from .utils import logger
try: try:
from . import sys_slvs from . import sys_slvs
except ImportError as e: except ImportError as e:
logger.warn('failed to import slvs: {}'.format(e)) logger.debug('failed to import slvs: {}'.format(e))
try: try:
from . import sys_sympy from . import sys_sympy
except ImportError as e: except ImportError as e:
logger.warn('failed to import sympy: {}'.format(e)) logger.debug('failed to import sympy: {}'.format(e))
import sys
if not 'freecad.asm3.sys_slvs' in sys.modules:
logger.warn('no solver backend found')
class Assembly3Workbench(FreeCADGui.Workbench): class Assembly3Workbench(FreeCADGui.Workbench):
from . import utils from . import utils
@ -35,7 +38,7 @@ class Assembly3Workbench(FreeCADGui.Workbench):
def Initialize(self): def Initialize(self):
from .mover import AsmDocumentObserver from .mover import AsmDocumentObserver
from .gui import AsmCmdManager,SelectionObserver from .gui import AsmCmdManager
cmdSet = set() cmdSet = set()
for name,cmds in AsmCmdManager.Toolbars.items(): for name,cmds in AsmCmdManager.Toolbars.items():
cmdSet.update(cmds) cmdSet.update(cmds)