improve handling if PySide(2) is not installed

This commit is contained in:
wmayer
2018-04-17 19:10:01 +02:00
parent c9267afc3b
commit de196eba26
2 changed files with 13 additions and 4 deletions

View File

@@ -24,7 +24,12 @@
from __future__ import absolute_import
import FreeCAD as App
from PySide import QtCore
try:
from PySide.QtCore import QT_TRANSLATE_NOOP
except ImportError:
def QT_TRANSLATE_NOOP(ctx, msg):
return msg
def editAttachment(feature = None,
take_selection = False,
@@ -72,9 +77,9 @@ class CommandEditAttachment:
'Command to edit attachment'
def GetResources(self):
return {'Pixmap': ':/icons/Part_Attachment.svg',
'MenuText': QtCore.QT_TRANSLATE_NOOP("AttachmentEditor","Attachment..."),
'MenuText': QT_TRANSLATE_NOOP("AttachmentEditor","Attachment..."),
'Accel': "",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("AttachmentEditor","Edit attachment of selected object.")}
'ToolTip': QT_TRANSLATE_NOOP("AttachmentEditor","Edit attachment of selected object.")}
def Activated(self):
try:

View File

@@ -42,7 +42,11 @@ class PartWorkbench ( Workbench ):
# load the module
import PartGui
import CompoundTools._CommandCompoundFilter
try:
import CompoundTools._CommandCompoundFilter
except ImportError as err:
FreeCAD.Console.PrintError("Features from CompoundTools package cannot be loaded. {err}\n".format(err= str(err)))
try:
bop = __import__("BOPTools")