From: Anthony Geay Date: Thu, 8 Feb 2024 07:02:36 +0000 (+0100) Subject: [EDF29150] : deal with not finished execs X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c169b88da5f8bab9639915a1006f89c131a12ebb;p=modules%2Fkernel.git [EDF29150] : deal with not finished execs --- diff --git a/src/Container/SALOME_ContainerHelper.py b/src/Container/SALOME_ContainerHelper.py index d8663afbd..23dd6a516 100644 --- a/src/Container/SALOME_ContainerHelper.py +++ b/src/Container/SALOME_ContainerHelper.py @@ -198,7 +198,9 @@ class ScriptExecInfo: @property def execTime(self): - return self.endExecTime - self.startExecTime + if ( self.endExecTime is not None ) and (self.startExecTime is not None): + return self.endExecTime - self.startExecTime + return None @property def fullExecTime(self): @@ -633,6 +635,8 @@ def ListAllExecContainIn( listOfContainerLogInfo ): For all ContainerLogInfo contained in listOfContainerLogInfo extract all ScriptExecInfo contained recursively in it. This method filters all "side" executions like those positionning environment for exemple. + See also : ListAllExecFinishedContainIn + Args: ----- @@ -647,6 +651,27 @@ def ListAllExecContainIn( listOfContainerLogInfo ): allexecs = sum( [sum( [[myexec for myexec in ps] for ps in cont],[] ) for cont in listOfContainerLogInfo], [] ) return [elt for elt in allexecs if elt.get() is not None] +def ListAllExecFinishedContainIn( listOfContainerLogInfo ): + """ + For all ContainerLogInfo contained in listOfContainerLogInfo extract all ScriptExecInfo contained recursively + in it. This method filters all "side" executions like those positionning environment for exemple and those not finished. + + See also : ListAllExecContainIn + + Args: + ----- + + listOfContainerLogInfo (list) : instance typically returned by salome.LogManagerLoadFromFile + + Returns + ------- + + list : all ScriptExecInfoDeco instance contained recursively in all input ContainerLogInfo instances + + """ + beforeFiltering = ListAllExecContainIn( listOfContainerLogInfo ) + return [elt for elt in beforeFiltering if elt.get().execTime is not None] + def IsExecTimeHigherThan( execInstDeco, limitDuration ): """ Example of Usage :