Skip to content

Commit

Permalink
Merge pull request #185 from dev-at-stellardeath-org/master
Browse files Browse the repository at this point in the history
PathProfile.py: Fix non-GUI usage
  • Loading branch information
wwmayer committed Jun 13, 2016
2 parents f13f57e + 7be3789 commit d514223
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Mod/Path/PathScripts/PathProfile.py
Expand Up @@ -33,6 +33,14 @@
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
Expand All @@ -43,16 +51,6 @@ def translate(ctxt, txt):

"""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):
Expand Down

0 comments on commit d514223

Please sign in to comment.