本文整理匯總了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):
#.........這裏部分代碼省略.........