本文整理汇总了Python中service.port.Port.exportXml方法的典型用法代码示例。如果您正苦于以下问题:Python Port.exportXml方法的具体用法?Python Port.exportXml怎么用?Python Port.exportXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service.port.Port
的用法示例。
在下文中一共展示了Port.exportXml方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: showExportDialog
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportXml [as 别名]
def showExportDialog(self, event):
""" Export active fit """
sFit = Fit.getInstance()
fit = sFit.getFit(self.getActiveFit())
defaultFile = "%s - %s.xml" % (fit.ship.item.name, fit.name) if fit else None
dlg = wx.FileDialog(self, "Save Fitting As...",
wildcard="EVE XML fitting files (*.xml)|*.xml",
style=wx.FD_SAVE,
defaultFile=defaultFile)
if dlg.ShowModal() == wx.ID_OK:
self.supress_left_up = True
format_ = dlg.GetFilterIndex()
path = dlg.GetPath()
if format_ == 0:
output = Port.exportXml(None, fit)
if '.' not in os.path.basename(path):
path += ".xml"
else:
print(("oops, invalid fit format %d" % format_))
try:
dlg.Destroy()
except RuntimeError:
pyfalog.error("Tried to destroy an object that doesn't exist in <showExportDialog>.")
return
with open(path, "w", encoding="utf-8") as openfile:
openfile.write(output)
openfile.close()
try:
dlg.Destroy()
except RuntimeError:
pyfalog.error("Tried to destroy an object that doesn't exist in <showExportDialog>.")
示例2: exportXml
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportXml [as 别名]
def exportXml(self, *fitIDs):
fits = map(lambda fitID: eos.db.getFit(fitID), fitIDs)
return Port.exportXml(*fits)
示例3: exportXml
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportXml [as 别名]
def exportXml(self, callback=None, *fitIDs):
fits = map(lambda fitID: eos.db.getFit(fitID), fitIDs)
return Port.exportXml(callback, *fits)
示例4: exportXml
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportXml [as 别名]
def exportXml(self, options, callback):
fit = getFit(self.mainFrame.getActiveFit())
Port.exportXml([fit], None, callback)
示例5: clipboardXml
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import exportXml [as 别名]
def clipboardXml(self, options):
fit = db_getFit(self.getActiveFit())
toClipboard(Port.exportXml(None, fit))