本文整理汇总了Python中exe.engine.package.Package.set_name方法的典型用法代码示例。如果您正苦于以下问题:Python Package.set_name方法的具体用法?Python Package.set_name怎么用?Python Package.set_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exe.engine.package.Package
的用法示例。
在下文中一共展示了Package.set_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Saver
# 需要导入模块: from exe.engine.package import Package [as 别名]
# 或者: from exe.engine.package.Package import set_name [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: render_POST
# 需要导入模块: from exe.engine.package import Package [as 别名]
# 或者: from exe.engine.package.Package import set_name [as 别名]
def render_POST(self, request):
#check the parameters
required_headers = ['ldshake_frame_origin','name','sectoken']
for r_h in required_headers:
if r_h not in request.args:
return 'error'
#get an id and increment the counter
self.id_count_lock.acquire()
id = self.id_count;
self.id_count += 1
self.id_count_lock.release()
package_name = request.args['sectoken'][0]
if 'document' not in request.args:
package = Package(package_name)
else:
fullpath = '/var/local/exelearning/' + package_name + '_' + str(random.randrange(1,999999)) + '.elp'
try:
elp_file = open(fullpath, "wb")
elp_file.write(request.args['document'][0])
elp_file.close()
package = Package.load(fullpath, True, None)
package.set_name(package_name)
except:
return 'error'
self.putChild(str(id), LdShakeDocument({
'name': request.args['name'][0],
'sectoken': request.args['sectoken'][0],
'ldshake_frame_origin': request.args['ldshake_frame_origin'][0]
}, self, package, self.webserver))
#return the resource URL
return request.prePathURL() + str(id) + '/'