mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-03 03:11:56 +02:00
[core] add Node.statusName property
This commit is contained in:
parent
81fe366365
commit
653cec28c9
1 changed files with 10 additions and 1 deletions
|
@ -351,11 +351,12 @@ class Node(BaseObject):
|
||||||
"""
|
"""
|
||||||
statusFile = self.statusFile()
|
statusFile = self.statusFile()
|
||||||
if not os.path.exists(statusFile):
|
if not os.path.exists(statusFile):
|
||||||
self.status.status = Status.NONE
|
self.upgradeStatusTo(Status.NONE)
|
||||||
return
|
return
|
||||||
with open(statusFile, 'r') as jsonFile:
|
with open(statusFile, 'r') as jsonFile:
|
||||||
statusData = json.load(jsonFile)
|
statusData = json.load(jsonFile)
|
||||||
self.status.fromDict(statusData)
|
self.status.fromDict(statusData)
|
||||||
|
self.statusChanged.emit()
|
||||||
|
|
||||||
def saveStatusFile(self):
|
def saveStatusFile(self):
|
||||||
"""
|
"""
|
||||||
|
@ -397,6 +398,7 @@ class Node(BaseObject):
|
||||||
print('WARNING: downgrade status on node "{}" from {} to {}'.format(self._name, self.status.status.name,
|
print('WARNING: downgrade status on node "{}" from {} to {}'.format(self._name, self.status.status.name,
|
||||||
newStatus))
|
newStatus))
|
||||||
self.status.status = newStatus
|
self.status.status = newStatus
|
||||||
|
self.statusChanged.emit()
|
||||||
self.saveStatusFile()
|
self.saveStatusFile()
|
||||||
|
|
||||||
def isAlreadySubmitted(self):
|
def isAlreadySubmitted(self):
|
||||||
|
@ -457,12 +459,19 @@ class Node(BaseObject):
|
||||||
def getStatus(self):
|
def getStatus(self):
|
||||||
return self.status
|
return self.status
|
||||||
|
|
||||||
|
@property
|
||||||
|
def statusName(self):
|
||||||
|
return self.status.status.name
|
||||||
|
|
||||||
name = Property(str, getName, constant=True)
|
name = Property(str, getName, constant=True)
|
||||||
attributes = Property(BaseObject, getAttributes, constant=True)
|
attributes = Property(BaseObject, getAttributes, constant=True)
|
||||||
internalFolderChanged = Signal()
|
internalFolderChanged = Signal()
|
||||||
internalFolder = Property(str, internalFolder.fget, notify=internalFolderChanged)
|
internalFolder = Property(str, internalFolder.fget, notify=internalFolderChanged)
|
||||||
depthChanged = Signal()
|
depthChanged = Signal()
|
||||||
depth = Property(int, depth.fget, notify=depthChanged)
|
depth = Property(int, depth.fget, notify=depthChanged)
|
||||||
|
statusChanged = Signal()
|
||||||
|
statusName = Property(str, statusName.fget, notify=statusChanged)
|
||||||
|
|
||||||
|
|
||||||
WHITE = 0
|
WHITE = 0
|
||||||
GRAY = 1
|
GRAY = 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue