本文整理汇总了Python中uiautomator.Device.sleep方法的典型用法代码示例。如果您正苦于以下问题:Python Device.sleep方法的具体用法?Python Device.sleep怎么用?Python Device.sleep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uiautomator.Device
的用法示例。
在下文中一共展示了Device.sleep方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ModelInfo
# 需要导入模块: from uiautomator import Device [as 别名]
# 或者: from uiautomator.Device import sleep [as 别名]
class ModelInfo():
'''
classdocs
'''
def __init__(self, deviceserial):
'''
Constructor
'''
#sndLog = CLS("test", "test")
self.osType = sys.platform
self.mstrInfo = {}
#self.devSerials = self.instAdb.device_serial()
self.mstrDevice = Device(deviceserial)
self.mstrInfo = self.mstrDevice.info
'''
DEVICE Infoamtions
{ u'displayRotation': 0,
u'displaySizeDpY': 640,
u'displaySizeDpX': 360,
u'currentPackageName': u'com.android.launcher',
u'productName': u'takju',
u'displayWidth': 720,
u'sdkInt': 18,
u'displayHeight': 1184,
u'naturalOrientation': True
}
'''
def getCurrntProductInfo(self):
return self.mstrInfo
def getProductNmae(self):
return self.mstrInfo['productName']
def getCurrntPkg(self):
return self.mstrInfo['currentPackageName']
def getSDKInt(self):
return self.mstrInfo['sdkInt']
def getRotation(self):
return self.mstrInfo['displayRotation']
def getNaturalOri(self):
return self.mstrInfo['naturalOrientation']
def getDisplayState(self):
return self.mstrDevice.screen
def setReflash(self):
pass
#define Key activity
def setDevScrnOn(self):
self.mstrDevice.screen.on()
def setMstDevScrnOff(self):
self.mstrDevice.screen.off()
def setWakeup(self):
self.mstrDevice.wakeup()
def setSleep(self):
self.mstrDevice.sleep()
#Hard key Soft key
def pressHome(self):
return self.mstrDevice.press.home()
def pressBack(self):
return self.mstrDevice.press.back()
######################################################################
def pressLeft(self):
return self.mstrDevice.press.left()
def pressRight(self):
return self.mstrDevice.press.right()
def pressUp(self):
return self.mstrDevice.press.up()
def pressDown(self):
return self.mstrDevice.press.down()
def pressCenter(self):
return self.mstrDevice.press.center()
######################################################################
def pressMenu(self):
#.........这里部分代码省略.........