本文整理汇总了Python中exe.engine.package.Package.save方法的典型用法代码示例。如果您正苦于以下问题:Python Package.save方法的具体用法?Python Package.save怎么用?Python Package.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exe.engine.package.Package
的用法示例。
在下文中一共展示了Package.save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Saver
# 需要导入模块: from exe.engine.package import Package [as 别名]
# 或者: from exe.engine.package.Package import save [as 别名]
class Saver():
def __init__(self,outputfilename="prova2.elp",titol="Exportacio de LliureX"):
self._outputfile = outputfilename
self._titol = titol
self.document = Package('LLiureX')
self.document.set_name('Lliurex')
self.document.set_description('Lliurex')
self.document.set_author('Lliurex')
self.document.set_title('Documentacio LLiurex')
def addWikipedia(self,title,url,parent):
W = WikipediaIdeviceLliurex(url)
W.set_title(title)
W.edit = False
W.loadArticle("")
W.undo = False
parent.addIdevice(W)
def save(self):
self.document.save(self._outputfile)
def AddNode(self,parent,titol):
Fill = parent.createChild();
Fill.setTitle(titol)
return Fill
def getRoot(self):
return self.document.root
示例2: handleExtractPackage
# 需要导入模块: from exe.engine.package import Package [as 别名]
# 或者: from exe.engine.package.Package import save [as 别名]
def handleExtractPackage(self, client, filename):
"""
Create a new package consisting of the current node and export
"""
filename = Path(filename)
saveDir = filename.dirname()
if saveDir and not saveDir.exists():
client.alert(_(u'Cannot access directory named ') +
unicode(saveDir) +
_(u'. Please use ASCII names.'))
return
if not filename.lower().endswith('.elp'):
filename += '.elp'
if Path(filename).exists():
client.alert(_(u'EXPORT FAILED.\n"%s" already exists.\n'
'Please try again with '
'a different filename') % filename)
return
package = Package(filename.namebase)
package.style = self.package.style
package.author = self.package.author
extractNode = self.package.currentNode.clone()
extractNode.mergeIntoPackage(package)
package.root = package.currentNode = extractNode
package.save(filename)
client.alert(_(u'Package saved to: %s' % filename))
示例3: __exportIdevice
# 需要导入模块: from exe.engine.package import Package [as 别名]
# 或者: from exe.engine.package.Package import save [as 别名]
def __exportIdevice(self, filename):
"""
export the current generic idevices.
"""
if not filename.endswith(".idp"):
filename = filename + ".idp"
name = Path(filename).namebase
package = Package(name)
package.idevices.append(self.editorPane.idevice.clone())
package.save(filename)
示例4: __exportIdevice
# 需要导入模块: from exe.engine.package import Package [as 别名]
# 或者: from exe.engine.package.Package import save [as 别名]
def __exportIdevice(self, filename):
"""
export the current generic idevices.
"""
if not filename.endswith('.idp'):
filename = filename + '.idp'
name = Path(filename).namebase
package = Package(name)
for idevice in self.ideviceStore.generic:
package.idevices.append(idevice.clone())
package.save(filename)
示例5: tick2
# 需要导入模块: from exe.engine.package import Package [as 别名]
# 或者: from exe.engine.package.Package import save [as 别名]
def tick2(self,package):
bkup = Package(package.name)
bkup = Package('bakcup')
package.root.copyToPackage(bkup)
bkup.save(package.name+'.bk')