From: André Ribes Date: Wed, 9 Mar 2011 14:31:01 +0000 (+0100) Subject: Déplacement du logger dans utils X-Git-Tag: V6_4_0rc3~70 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=49417f90bc01b7a3b9d169ae92adebb276475ffc;p=modules%2Fadao.git Déplacement du logger dans utils --- diff --git a/src/daSalome/daGUI/ADAO.py b/src/daSalome/daGUI/ADAO.py index 0d1e1e3..1875621 100644 --- a/src/daSalome/daGUI/ADAO.py +++ b/src/daSalome/daGUI/ADAO.py @@ -21,7 +21,7 @@ import ADAO_COMPONENT__POA import SALOME_ComponentPy import SALOME_DriverPy -from daGuiImpl.adaoLogger import * +from daUtils.adaoLogger import * class ADAO(ADAO_COMPONENT__POA.ADAO_ENGINE, SALOME_ComponentPy.SALOME_ComponentPy_i, diff --git a/src/daSalome/daGUI/ADAOGUI.py b/src/daSalome/daGUI/ADAOGUI.py index 43b361e..caffc37 100644 --- a/src/daSalome/daGUI/ADAOGUI.py +++ b/src/daSalome/daGUI/ADAOGUI.py @@ -30,7 +30,7 @@ reasons: """ from daGuiImpl import ADAOGUI_impl as GuiImpl -from daGuiImpl import adaoLogger +from daUtils import adaoLogger adaoLogger.debug("Import ADAOGUI") diff --git a/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py b/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py index 8538879..d48d2b6 100644 --- a/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py +++ b/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py @@ -28,7 +28,7 @@ from PyQt4.QtCore import * # Import from PyQT from PyQt4.QtAssistant import * # Import from PyQT from daUtils.adaoEficasEvent import * -from daGuiImpl.adaoLogger import * +from daUtils.adaoLogger import * # # ============================================ diff --git a/src/daSalome/daGUI/daGuiImpl/Makefile.am b/src/daSalome/daGUI/daGuiImpl/Makefile.am index 4ea27e7..17cfa25 100644 --- a/src/daSalome/daGUI/daGuiImpl/Makefile.am +++ b/src/daSalome/daGUI/daGuiImpl/Makefile.am @@ -28,7 +28,6 @@ mypkgpython_PYTHON = \ adaoGuiHelper.py \ adaoModuleHelper.py \ adaoStudyEditor.py \ - adaoLogger.py \ adaoCase.py diff --git a/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py index 61730ad..b58b278 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py @@ -39,7 +39,7 @@ from daEficasWrapper.adaoEficasWrapper import AdaoEficasWrapper from daUtils.adaoEficasEvent import * import adaoGuiHelper import adaoStudyEditor -import adaoLogger +from daUtils import adaoLogger __cases__ = {} diff --git a/src/daSalome/daGUI/daGuiImpl/adaoLogger.py b/src/daSalome/daGUI/daGuiImpl/adaoLogger.py deleted file mode 100644 index c0c8cad..0000000 --- a/src/daSalome/daGUI/daGuiImpl/adaoLogger.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2010 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 -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# 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 -# - -from salome.kernel.logger import Logger -from salome.kernel import termcolor - -adao_logger = Logger("ADAO") -adao_engine_logger = Logger("ADAO ENGINE") - -def info(msg, logger = "ADAO"): - - if logger == "ADAO": - adao_logger.setColor(termcolor.BLUE) - adao_logger.info(msg) - elif logger == "ENGINE": - adao_engine_logger.setColor(termcolor.BLUE) - adao_engine_logger.info(msg) - -def debug(msg, logger = "ADAO"): - - if logger == "ADAO": - adao_logger.setColor(termcolor.GREEN) - adao_logger.debug(msg) - elif logger == "ENGINE": - adao_engine_logger.setColor(termcolor.GREEN) - adao_engine_logger.debug(msg) - -def error(msg, logger = "ADAO"): - - if logger == "ADAO": - adao_logger.setColor(termcolor.RED) - adao_logger.error(msg) - elif logger == "ENGINE": - adao_engine_logger.setColor(termcolor.RED) - adao_engine_logger.error(msg) - -def warning(msg, logger = "ADAO"): - - if logger == "ADAO": - adao_logger.setColor(termcolor.CYAN) - adao_logger.warning(msg) - elif logger == "ENGINE": - adao_engine_logger.setColor(termcolor.CYAN) - adao_engine_logger.warning(msg) diff --git a/src/daSalome/daGUI/daUtils/Makefile.am b/src/daSalome/daGUI/daUtils/Makefile.am index 9315c40..4a03778 100644 --- a/src/daSalome/daGUI/daUtils/Makefile.am +++ b/src/daSalome/daGUI/daUtils/Makefile.am @@ -24,5 +24,6 @@ mypkgpythondir =$(salomepythondir)/daUtils mypkgpython_PYTHON = \ __init__.py \ adaoEficasEvent.py \ + adaoLogger.py \ enumerate.py diff --git a/src/daSalome/daGUI/daUtils/adaoLogger.py b/src/daSalome/daGUI/daUtils/adaoLogger.py new file mode 100644 index 0000000..c0c8cad --- /dev/null +++ b/src/daSalome/daGUI/daUtils/adaoLogger.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2010 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 +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# 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 +# + +from salome.kernel.logger import Logger +from salome.kernel import termcolor + +adao_logger = Logger("ADAO") +adao_engine_logger = Logger("ADAO ENGINE") + +def info(msg, logger = "ADAO"): + + if logger == "ADAO": + adao_logger.setColor(termcolor.BLUE) + adao_logger.info(msg) + elif logger == "ENGINE": + adao_engine_logger.setColor(termcolor.BLUE) + adao_engine_logger.info(msg) + +def debug(msg, logger = "ADAO"): + + if logger == "ADAO": + adao_logger.setColor(termcolor.GREEN) + adao_logger.debug(msg) + elif logger == "ENGINE": + adao_engine_logger.setColor(termcolor.GREEN) + adao_engine_logger.debug(msg) + +def error(msg, logger = "ADAO"): + + if logger == "ADAO": + adao_logger.setColor(termcolor.RED) + adao_logger.error(msg) + elif logger == "ENGINE": + adao_engine_logger.setColor(termcolor.RED) + adao_engine_logger.error(msg) + +def warning(msg, logger = "ADAO"): + + if logger == "ADAO": + adao_logger.setColor(termcolor.CYAN) + adao_logger.warning(msg) + elif logger == "ENGINE": + adao_engine_logger.setColor(termcolor.CYAN) + adao_engine_logger.warning(msg)