本文整理汇总了Python中Library.listEmulators方法的典型用法代码示例。如果您正苦于以下问题:Python Library.listEmulators方法的具体用法?Python Library.listEmulators怎么用?Python Library.listEmulators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library.listEmulators方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_emulators
# 需要导入模块: import Library [as 别名]
# 或者: from Library import listEmulators [as 别名]
def get_emulators():
'''
Display list of emulators
'''
ET.register_namespace("test", "http://127.0.0.1/cocoma")
response.set_header('Content-Type', 'application/vnd.bonfire+xml')
response.set_header('Accept', '*/*')
response.set_header('Allow', 'GET, HEAD')
emuList=Library.listEmulators("all")
#print "emulist",emuList
'''
XML namespaces are used for providing uniquely named elements and attributes in an XML document.
'''
#building the XML we will return
emulators = ET.Element('collection', { 'xmlns':'http://127.0.0.1/cocoma','href':'/emulators'})
#<items offset="0" total="2">
items =ET.SubElement(emulators,'items', { 'offset':'0','total':str(len(emuList))})
#<emulator href="/emulations/1" name="Emu1"/>
for elem in emuList :
emulator = ET.SubElement(items,'emulator', { 'href':'/emulators/'+str(elem),'name':str(elem)})
#<link href="/" rel="parent" type="application/vnd.cocoma+xml"/>
lk = ET.SubElement(emulators, 'link', {'rel':'parent', 'href':'/', 'type':'application/vnd.bonfire+xml'})
return prettify(emulators)
示例2: noExtraOptions
# 需要导入模块: import Library [as 别名]
# 或者: from Library import listEmulators [as 别名]
for distName in distroList:
print distName
'''
################################
listEmulators
###############################
'''
if options.listAllEmulators:
noExtraOptions(options, "listAllEmulators")
if len(arguments)>0:
try:
emuList2=Library.listEmulators(arguments[0])
print emuList2
except Exception, e:
print "Error: ",e
print "Emulator \"%s\" not found. Check name."%(arguments[0])
else:
emuList=Library.listEmulators("all")
print "\nAvailable Emulators:"
for emuName in emuList:
print emuName
'''
################################