本文整理汇总了Python中service.port.Port.exportDna方法的典型用法代码示例。如果您正苦于以下问题:Python Port.exportDna方法的具体用法?Python Port.exportDna怎么用?Python Port.exportDna使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service.port.Port
的用法示例。
在下文中一共展示了Port.exportDna方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generateMinimalHTML
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportDna [as 别名]
def generateMinimalHTML(self, sMkt, sFit, dnaUrl):
""" Generate a minimal HTML version of the fittings, without any javascript or styling"""
categoryList = list(sMkt.getShipRoot())
categoryList.sort(key=lambda _ship: _ship.name)
count = 0
HTML = ''
for group in categoryList:
# init market group string to give ships something to attach to
ships = list(sMkt.getShipList(group.ID))
ships.sort(key=lambda _ship: _ship.name)
ships.sort(key=lambda _ship: _ship.name)
for ship in ships:
fits = sFit.getFitsWithShip(ship.ID)
for fit in fits:
if self.stopRunning:
return
try:
dnaFit = Port.exportDna(getFit(fit[0]))
HTML += '<a class="outOfGameBrowserLink" target="_blank" href="' + dnaUrl + dnaFit + '">' \
+ ship.name + ': ' + \
fit[1] + '</a><br> \n'
except:
pyfalog.error("Failed to export line")
continue
finally:
if self.callback:
wx.CallAfter(self.callback, count)
count += 1
return HTML
示例2: exportDna
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportDna [as 别名]
def exportDna(self, fitID):
fit = eos.db.getFit(fitID)
return Port.exportDna(fit)
示例3: exportDna
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportDna [as 别名]
def exportDna(self, options, callback):
fit = getFit(self.mainFrame.getActiveFit())
Port.exportDna(fit, options, callback)
示例4: clipboardDna
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportDna [as 别名]
def clipboardDna(self, options):
fit = db_getFit(self.getActiveFit())
toClipboard(Port.exportDna(fit))
示例5: generateFullHTML
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportDna [as 别名]
#.........这里部分代码省略.........
$('a[data-dna]').each(function( index ) {
var dna = $(this).data('dna');
if (typeof CCPEVE !== 'undefined') { // inside IGB
$(this).attr('href', 'javascript:CCPEVE.showFitting("'+dna+'");');}
else { // outside IGB
$(this).attr('href', '%s'+dna); }
});
});
</script>
</head>
<body>
<div id="canvas" data-role="page">
<div data-role="header">
<h1>Pyfa fits</h1>
</div>
<div data-role="content">
<div style="text-align: center;"><strong>Last updated:</strong> %s <small>(<span class="timer"></span>)</small></div>
""" % (time.time(), dnaUrl, localDate)
HTML += ' <ul data-role="listview" class="ui-listview-outer" data-inset="true" data-filter="true">\n'
categoryList = list(sMkt.getShipRoot())
categoryList.sort(key=lambda _ship: _ship.name)
count = 0
for group in categoryList:
# init market group string to give ships something to attach to
HTMLgroup = ''
ships = list(sMkt.getShipList(group.ID))
ships.sort(key=lambda _ship: _ship.name)
# Keep track of how many ships per group
groupFits = 0
for ship in ships:
fits = sFit.getFitsWithShip(ship.ID)
if len(fits) > 0:
groupFits += len(fits)
if len(fits) == 1:
if self.stopRunning:
return
fit = fits[0]
try:
dnaFit = Port.exportDna(getFit(fit[0]))
HTMLgroup += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + ship.name + ": " + \
fit[1] + '</a></li>\n'
except:
pyfalog.warning("Failed to export line")
pass
finally:
if self.callback:
wx.CallAfter(self.callback, count)
count += 1
else:
# Ship group header
HTMLship = (
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" data-corners="false">\n'
' <h2>' + ship.name + ' <span class="ui-li-count">' + str(
len(fits)) + '</span></h2>\n'
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n'
)
for fit in fits:
if self.stopRunning:
return
try:
dnaFit = Port.exportDna(getFit(fit[0]))
print dnaFit
HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[
1] + '</a></li>\n'
except:
pyfalog.warning("Failed to export line")
continue
finally:
if self.callback:
wx.CallAfter(self.callback, count)
count += 1
HTMLgroup += HTMLship + (' </ul>\n'
' </li>\n')
if groupFits > 0:
# Market group header
HTML += (
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" data-corners="false">\n'
' <h2>' + group.groupName + ' <span class="ui-li-count">' + str(groupFits) + '</span></h2>\n'
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n' + HTMLgroup +
' </ul>\n'
' </li>'
)
HTML += """
</ul>
</div>
</div>
</body>
</html>"""
return HTML
示例6: exportDna
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportDna [as 别名]
def exportDna(self, fitID):
return Port.exportDna(fitID)