本文整理汇总了Python中devicemanager.DeviceManager.getInfo方法的典型用法代码示例。如果您正苦于以下问题:Python DeviceManager.getInfo方法的具体用法?Python DeviceManager.getInfo怎么用?Python DeviceManager.getInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类devicemanager.DeviceManager
的用法示例。
在下文中一共展示了DeviceManager.getInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from devicemanager import DeviceManager [as 别名]
# 或者: from devicemanager.DeviceManager import getInfo [as 别名]
def main():
dm_none = DeviceManager(None, None)
automation = RemoteAutomation(dm_none)
parser = RemoteOptions(automation)
options, args = parser.parse_args()
if (options.deviceIP == None):
print "Error: you must provide a device IP to connect to via the --device option"
sys.exit(1)
dm = DeviceManager(options.deviceIP, options.devicePort)
automation.setDeviceManager(dm)
if (options.remoteProductName != None):
automation.setProduct(options.remoteProductName)
# Set up the defaults and ensure options are set
options = parser.verifyRemoteOptions(options)
if (options == None):
print "ERROR: Invalid options specified, use --help for a list of valid options"
sys.exit(1)
parts = dm.getInfo('screen')['screen'][0].split()
width = int(parts[0].split(':')[1])
height = int(parts[1].split(':')[1])
if (width < 1050 or height < 1050):
print "ERROR: Invalid screen resolution %sx%s, please adjust to 1366x1050 or higher" % (width, height)
sys.exit(1)
automation.setAppName(options.app)
automation.setRemoteProfile(options.remoteProfile)
automation.setRemoteLog(options.remoteLogFile)
reftest = RemoteReftest(automation, dm, options, SCRIPT_DIRECTORY)
# Start the webserver
reftest.startWebServer(options)
# Hack in a symbolic link for jsreftest
os.system("ln -s ../jsreftest " + str(os.path.join(SCRIPT_DIRECTORY, "jsreftest")))
# Dynamically build the reftest URL if possible, beware that args[0] should exist 'inside' the webroot
manifest = args[0]
if os.path.exists(os.path.join(SCRIPT_DIRECTORY, args[0])):
manifest = "http://" + str(options.remoteWebServer) + ":" + str(options.httpPort) + "/" + args[0]
elif os.path.exists(args[0]):
manifestPath = os.path.abspath(args[0]).split(SCRIPT_DIRECTORY)[1].strip('/')
manifest = "http://" + str(options.remoteWebServer) + ":" + str(options.httpPort) + "/" + manifestPath
procName = options.app.split('/')[-1]
if (dm.processExist(procName)):
dm.killProcess(procName)
#an example manifest name to use on the cli
# manifest = "http://" + options.remoteWebServer + "/reftests/layout/reftests/reftest-sanity/reftest.list"
reftest.runTests(manifest, options)
reftest.stopWebServer(options)