MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / backupFitsWorkerFunc

Method backupFitsWorkerFunc

service/port/port.py:78–92  ·  view source on GitHub ↗
(path, progress)

Source from the content-addressed store, hash-verified

76 pyfalog.debug("Starting backup fits thread.")
77
78 def backupFitsWorkerFunc(path, progress):
79 try:
80 backedUpFits = Port.exportXml(svcFit.getInstance().getAllFits(), progress)
81 if backedUpFits:
82 progress.message = f'writing {path}'
83 backupFile = open(path, "w", encoding="utf-8")
84 backupFile.write(backedUpFits)
85 backupFile.close()
86 except (KeyboardInterrupt, SystemExit):
87 raise
88 except Exception as e:
89 progress.error = f'{e}'
90 finally:
91 progress.current += 1
92 progress.workerWorking = False
93
94 threading.Thread(
95 target=backupFitsWorkerFunc,

Callers

nothing calls this directly

Calls 4

getAllFitsMethod · 0.80
exportXmlMethod · 0.45
getInstanceMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected