+# Copyright (C) 2016-2024 CEA, EDF
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
class Logger(object):
"""
Debug Info.
@classmethod
def __log(cls, typ, msg):
- print "%s: %s" % (typ, msg)
+ print("%s: %s" % (typ, msg))
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):
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