mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-10 15:46:54 +02:00
[ui] change SubmittedOrRunning function to only Running, string computation, function naming
This commit is contained in:
parent
a29061efd5
commit
a5de8b86dc
2 changed files with 25 additions and 17 deletions
|
@ -411,11 +411,12 @@ class NodeChunk(BaseObject):
|
|||
try:
|
||||
self.node.nodeDesc.processChunk(self)
|
||||
except Exception as e:
|
||||
self._status.elapsedTime = time.time() - startTime
|
||||
if self._status.status != Status.STOPPED:
|
||||
self._status.elapsedTime = time.time() - startTime
|
||||
self.upgradeStatusTo(Status.ERROR)
|
||||
raise
|
||||
except (KeyboardInterrupt, SystemError, GeneratorExit) as e:
|
||||
self._status.elapsedTime = time.time() - startTime
|
||||
self.upgradeStatusTo(Status.STOPPED)
|
||||
raise
|
||||
finally:
|
||||
|
@ -806,6 +807,14 @@ class BaseNode(BaseObject):
|
|||
shutil.rmtree(self.internalFolder)
|
||||
self.updateStatusFromCache()
|
||||
|
||||
@Slot(result=str)
|
||||
def getStartDateTime(self):
|
||||
""" Return the date (str) of the first running chunk """
|
||||
if not self.isAlreadySubmittedOrFinished() or len(self._chunks) == 0:
|
||||
return ""
|
||||
dateTime = [chunk._status.startDateTime for chunk in self._chunks if chunk._status.startDateTime != ""]
|
||||
return min(dateTime) if len(dateTime) != 0 else ""
|
||||
|
||||
def isAlreadySubmitted(self):
|
||||
for chunk in self._chunks:
|
||||
if chunk.isAlreadySubmitted():
|
||||
|
@ -828,13 +837,10 @@ class BaseNode(BaseObject):
|
|||
return True
|
||||
return False
|
||||
|
||||
@Slot(result=str)
|
||||
def getFirstChunkRunning(self):
|
||||
""" Return the date (str) of the first running chunk """
|
||||
if not self.isAlreadySubmittedOrFinished() or len(self._chunks) == 0:
|
||||
return ""
|
||||
dateTime = [chunk._status.startDateTime for chunk in self._chunks if chunk._status.startDateTime != ""]
|
||||
return min(dateTime) if len(dateTime) != 0 else ""
|
||||
@Slot(result=bool)
|
||||
def isRunning(self):
|
||||
""" Return True if at least one chunk of this Node is running, False otherwise. """
|
||||
return any(chunk.isRunning() for chunk in self._chunks)
|
||||
|
||||
@Slot(result=bool)
|
||||
def isFinishedOrRunning(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue