本文整理汇总了Python中service.port.Port.backupFits方法的典型用法代码示例。如果您正苦于以下问题:Python Port.backupFits方法的具体用法?Python Port.backupFits怎么用?Python Port.backupFits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service.port.Port
的用法示例。
在下文中一共展示了Port.backupFits方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: backupToXml
# 需要导入模块: from service.port import Port [as 别名]
# 或者: from service.port.Port import backupFits [as 别名]
def backupToXml(self, event):
""" Back up all fits to EVE XML file """
defaultFile = "pyfa-fits-%s.xml" % strftime("%Y%m%d_%H%M%S", gmtime())
saveDialog = wx.FileDialog(
self,
"Save Backup As...",
wildcard="EVE XML fitting file (*.xml)|*.xml",
style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT,
defaultFile=defaultFile,
)
if saveDialog.ShowModal() == wx.ID_OK:
filePath = saveDialog.GetPath()
if '.' not in os.path.basename(filePath):
filePath += ".xml"
sFit = Fit.getInstance()
max_ = sFit.countAllFits()
self.progressDialog = wx.ProgressDialog(
"Backup fits",
"Backing up %d fits to: %s" % (max_, filePath),
maximum=max_,
parent=self,
style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL
)
Port.backupFits(filePath, self)
self.progressDialog.ShowModal()