Merge pull request #185 from dev-at-stellardeath-org/master
PathProfile.py: Fix non-GUI usage
This commit is contained in:
commit
d51422347c
|
@ -33,6 +33,14 @@ if FreeCAD.GuiUp:
|
|||
import FreeCADGui
|
||||
from PySide import QtCore, QtGui
|
||||
from DraftTools import translate
|
||||
# Qt tanslation handling
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
def translate(context, text, disambig=None):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def translate(context, text, disambig=None):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
else:
|
||||
def translate(ctxt, txt):
|
||||
return txt
|
||||
|
@ -43,16 +51,6 @@ __url__ = "http://www.freecadweb.org"
|
|||
|
||||
"""Path Profile object and FreeCAD command"""
|
||||
|
||||
# Qt tanslation handling
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
def translate(context, text, disambig=None):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def translate(context, text, disambig=None):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
|
||||
|
||||
class ObjectProfile:
|
||||
|
||||
def __init__(self, obj):
|
||||
|
|
Loading…
Reference in New Issue
Block a user