X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=tools%2FCurvePlot%2Fsrc%2Fpython%2Fcontroller%2Futils.py.in;h=8ea430539adb55775a00a01c6b6acf3e95f33dbe;hb=8091ffdec0e55752a16ec4d46ac1b944fc1e1ddf;hp=e2f0d27788947837fc068b6dd578294024c7f51f;hpb=fd22340460025ea5a2b068a75787c8666324238b;p=modules%2Fgui.git diff --git a/tools/CurvePlot/src/python/controller/utils.py.in b/tools/CurvePlot/src/python/controller/utils.py.in index e2f0d2778..8ea430539 100644 --- a/tools/CurvePlot/src/python/controller/utils.py.in +++ b/tools/CurvePlot/src/python/controller/utils.py.in @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2019 CEA/DEN, EDF R&D +# Copyright (C) 2016-2021 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -78,20 +78,20 @@ class Logger(object): def trQ(tag, context="CURVEPLOT"): """ @return a QString read from the translation file """ - from pyqtside.QtGui import QApplication + from pyqtside.QtWidgets import QApplication return QApplication.translate(context, tag) def trU(tag, context="CURVEPLOT"): """ @return same as above, but returns a Python unicode string. """ qs = trQ(tag, context) - return unicode(qs, 'utf-8') + return str(qs, 'utf-8') def toUnicodeWithWarning(s, method_name): try: - s = unicode(s) + s = str(s) except: Logger.Warning("%s - warning, passing non-unicode, non-ASCII string '%s'! Trying to convert myself to UTF-8 ..." % (method_name, s)) - s = unicode(s, 'utf-8') + s = str(s, 'utf-8') return s def completeResPath(fileName): @@ -100,5 +100,7 @@ def completeResPath(fileName): rd = os.environ.get("CURVEPLOT_ROOT_DIR", None) if rd is None: raise Exception("CURVEPLOT_ROOT_DIR is not defined!") + if @SALOME_CURVEPLOT_TEST_MODE@: # do not remove automatically modified in CMake config + subPath = "@CRVPLOT_TEST_INSTALL@" filePath = os.path.join(rd, subPath, fileName) return filePath