1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2024 CEA, EDF
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 from SALOME_ContainerHelper import ScriptExecInfo
26 class SALOME_ContainerScriptExecPerfLog:
27 def __init__(self, father):
29 self._start_pos = None
38 self._stop_pos = os.path.getsize( self.father.father.logfilename )
39 setattr(obj,"tracePosStop",self._stop_pos)
40 setattr(obj,"tracePosStart",self._start_pos)
41 return pickle.dumps(obj)
44 self._start_pos = os.path.getsize( self.father.father.logfilename )
46 class SALOME_ContainerScriptPerfLog:
47 def __init__(self, father):
54 def addExecution(self):
55 return SALOME_ContainerScriptExecPerfLog(self)
57 class SALOME_ContainerPerfLog:
58 def __init__(self,contInNS,logfile):
59 self._container_in_ns = contInNS
60 self._log_filename = logfile
63 def logfilename(self):
64 return self._log_filename
71 return SALOME_ContainerScriptPerfLog(self)
73 class SALOME_LogManagerHelper:
77 def declareContainer(self, contInNS,logfile):
78 inst = SALOME_ContainerPerfLog(contInNS,logfile)