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

Method run

gui/utils/exportHtml.py:48–81  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46 self.stopRunning = True
47
48 def run(self):
49 # wait 1 second just in case a lot of modifications get made
50 time.sleep(1)
51 if self.stopRunning:
52 return
53
54 sMkt = Market.getInstance()
55 sFit = Fit.getInstance()
56 settings = HTMLExportSettings.getInstance()
57
58 minimal = settings.getMinimalEnabled()
59 dnaUrl = "https://o.smium.org/loadout/dna/"
60
61 if minimal:
62 HTML = self.generateMinimalHTML(sMkt, sFit, dnaUrl)
63 else:
64 HTML = self.generateFullHTML(sMkt, sFit, dnaUrl)
65
66 try:
67 FILE = open(settings.getPath(), "w", encoding='utf-8')
68 FILE.write(HTML)
69 FILE.close()
70 except IOError as ex:
71 pyfalog.warning("Failed to write to " + settings.getPath())
72 pass
73 except (KeyboardInterrupt, SystemExit):
74 raise
75 except Exception as e:
76 if self.progress:
77 self.progress.error = f'{e}'
78 finally:
79 if self.progress:
80 self.progress.current += 1
81 self.progress.workerWorking = False
82
83 def generateFullHTML(self, sMkt, sFit, dnaUrl):
84 """ Generate the complete HTML with styling and javascript """

Callers

nothing calls this directly

Calls 6

generateMinimalHTMLMethod · 0.95
generateFullHTMLMethod · 0.95
getMinimalEnabledMethod · 0.80
getPathMethod · 0.80
getInstanceMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected