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

Method run

service/character.py:116–135  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114 self.running = True
115
116 def run(self):
117 path = self.path
118 sCharacter = Character.getInstance()
119
120 backupData = None
121 if self.running:
122 if self.saveFmt == "xml" or self.saveFmt == "emp":
123 backupData = sCharacter.exportXml()
124 else:
125 backupData = sCharacter.exportText()
126
127 if self.running and backupData is not None:
128 if self.saveFmt == "emp":
129 with gzip.open(path, mode='wb') as backupFile:
130 backupFile.write(backupData.encode())
131 else:
132 with open(path, mode='w', encoding='utf-8') as backupFile:
133 backupFile.write(backupData)
134
135 wx.CallAfter(self.callback)
136
137 def stop(self):
138 self.running = False

Callers

nothing calls this directly

Calls 4

exportTextMethod · 0.80
getInstanceMethod · 0.45
exportXmlMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected