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

Method generateMinimalHTML

gui/utils/exportHtml.py:329–363  ·  view source on GitHub ↗

Generate a minimal HTML version of the fittings, without any javascript or styling

(self, sMkt, sFit, dnaUrl)

Source from the content-addressed store, hash-verified

327 return HTML
328
329 def generateMinimalHTML(self, sMkt, sFit, dnaUrl):
330 """ Generate a minimal HTML version of the fittings, without any javascript or styling"""
331 categoryList = list(sMkt.getShipRoot())
332 categoryList.sort(key=lambda _ship: _ship.name)
333
334 count = 0
335 HTML = ''
336 for group in categoryList:
337 # init market group string to give ships something to attach to
338
339 ships = list(sMkt.getShipList(group.ID))
340 ships.sort(key=lambda _ship: _ship.name)
341
342 ships.sort(key=lambda _ship: _ship.name)
343
344 for ship in ships:
345 fits = sFit.getFitsWithShip(ship.ID)
346 for fit in fits:
347 if self.stopRunning:
348 return
349 try:
350 dnaFit = Port.exportDna(getFit(fit[0]))
351 HTML += '<a class="outOfGameBrowserLink" target="_blank" href="' + dnaUrl + dnaFit + '">' \
352 + ship.name + ': ' + \
353 fit[1] + '</a><br> \n'
354 except (KeyboardInterrupt, SystemExit):
355 raise
356 except:
357 pyfalog.error("Failed to export line")
358 continue
359 finally:
360 if self.progress:
361 self.progress.current = count
362 count += 1
363 return HTML

Callers 1

runMethod · 0.95

Calls 6

getFitFunction · 0.90
getShipRootMethod · 0.80
getShipListMethod · 0.80
getFitsWithShipMethod · 0.80
sortMethod · 0.45
exportDnaMethod · 0.45

Tested by

no test coverage detected