mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-13 14:57:22 +02:00
[core] fix StatusData inheritance
This commit is contained in:
parent
9304919c95
commit
5e7b044d13
1 changed files with 9 additions and 7 deletions
|
@ -63,7 +63,8 @@ class StatusData(BaseObject):
|
||||||
"""
|
"""
|
||||||
dateTimeFormatting = '%Y-%m-%d %H:%M:%S.%f'
|
dateTimeFormatting = '%Y-%m-%d %H:%M:%S.%f'
|
||||||
|
|
||||||
def __init__(self, nodeName='', nodeType='', packageName='', packageVersion=''):
|
def __init__(self, nodeName='', nodeType='', packageName='', packageVersion='', parent=None):
|
||||||
|
super(StatusData, self).__init__(parent)
|
||||||
self.status = Status.NONE
|
self.status = Status.NONE
|
||||||
self.execMode = ExecMode.NONE
|
self.execMode = ExecMode.NONE
|
||||||
self.nodeName = nodeName
|
self.nodeName = nodeName
|
||||||
|
@ -113,6 +114,7 @@ class StatusData(BaseObject):
|
||||||
|
|
||||||
def toDict(self):
|
def toDict(self):
|
||||||
d = self.__dict__.copy()
|
d = self.__dict__.copy()
|
||||||
|
d.pop('destroyed', None) # skip non data attributes from BaseObject
|
||||||
d["elapsedTimeStr"] = self.elapsedTimeStr
|
d["elapsedTimeStr"] = self.elapsedTimeStr
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
@ -161,7 +163,7 @@ class LogManager:
|
||||||
def start(self, level):
|
def start(self, level):
|
||||||
# Clear log file
|
# Clear log file
|
||||||
open(self.chunk.logFile, 'w').close()
|
open(self.chunk.logFile, 'w').close()
|
||||||
|
|
||||||
self.configureLogger()
|
self.configureLogger()
|
||||||
self.logger.setLevel(self.textToLevel(level))
|
self.logger.setLevel(self.textToLevel(level))
|
||||||
self.progressBar = False
|
self.progressBar = False
|
||||||
|
@ -178,19 +180,19 @@ class LogManager:
|
||||||
self.progressEnd = end
|
self.progressEnd = end
|
||||||
self.currentProgressTics = 0
|
self.currentProgressTics = 0
|
||||||
self.progressBar = True
|
self.progressBar = True
|
||||||
|
|
||||||
with open(self.chunk.logFile, 'a') as f:
|
with open(self.chunk.logFile, 'a') as f:
|
||||||
if message:
|
if message:
|
||||||
f.write(message+'\n')
|
f.write(message+'\n')
|
||||||
f.write('0% 10 20 30 40 50 60 70 80 90 100%\n')
|
f.write('0% 10 20 30 40 50 60 70 80 90 100%\n')
|
||||||
f.write('|----|----|----|----|----|----|----|----|----|----|\n\n')
|
f.write('|----|----|----|----|----|----|----|----|----|----|\n\n')
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
with open(self.chunk.logFile, 'r') as f:
|
with open(self.chunk.logFile, 'r') as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
self.progressBarPosition = content.rfind('\n')
|
self.progressBarPosition = content.rfind('\n')
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def updateProgressBar(self, value):
|
def updateProgressBar(self, value):
|
||||||
|
@ -332,7 +334,7 @@ class NodeChunk(BaseObject):
|
||||||
os.makedirs(folder)
|
os.makedirs(folder)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
statusFilepathWriting = getWritingFilepath(statusFilepath)
|
statusFilepathWriting = getWritingFilepath(statusFilepath)
|
||||||
with open(statusFilepathWriting, 'w') as jsonFile:
|
with open(statusFilepathWriting, 'w') as jsonFile:
|
||||||
json.dump(data, jsonFile, indent=4)
|
json.dump(data, jsonFile, indent=4)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue