本文整理汇总了Python中exe.engine.package.Package.style方法的典型用法代码示例。如果您正苦于以下问题:Python Package.style方法的具体用法?Python Package.style怎么用?Python Package.style使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exe.engine.package.Package
的用法示例。
在下文中一共展示了Package.style方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handleExtractPackage
# 需要导入模块: from exe.engine.package import Package [as 别名]
# 或者: from exe.engine.package.Package import style [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))