本文整理汇总了Python中utils.logger.Logger.d方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.d方法的具体用法?Python Logger.d怎么用?Python Logger.d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils.logger.Logger
的用法示例。
在下文中一共展示了Logger.d方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __monkey_checker
# 需要导入模块: from utils.logger import Logger [as 别名]
# 或者: from utils.logger.Logger import d [as 别名]
def __monkey_checker(self):
__act = self.__android_helper.getCurAct()
__app = self.__android_helper.getCurApp()
Logger.d("App: %s, Act: %s " % (__act, __app))
# 第一次进入,设置Act为当前Act
if self.__current_act == '':
self.__current_act = __act
self.__max_thinking_time = SETTING().get_max_thinging_time()
self.__think_max_count = random.randint(1, self.__max_thinking_time)
Logger.d("New Acticity, Max thing time = %s s" % self.__think_max_count)
#如果两次相同,发送2次Back按键,并设置Act为空
elif self.__current_act == __act:
if self.__think_count == self.__think_max_count:
self.__android_helper.senKey(4)
self.__android_helper.senKey(4)
self.__current_act = ''
self.__think_count = 0
Logger.d("Seam Acticity Max count: Back.")
else:
self.__think_count += 1
Logger.d("Seam Activity think count " + str(self.__think_count))
#如果两次不相同,则设置Act为当前act
else:
self.__current_act = __act
self.__max_thinking_time = SETTING().get_max_thinging_time()
self.__think_max_count = random.randint(1, self.__max_thinking_time)
self.__think_count = 0
Logger.d("Diff Activity think count empty, Reset Max thing time = %s s" % self.__think_max_count)
示例2: getDevicesInfo
# 需要导入模块: from utils.logger import Logger [as 别名]
# 或者: from utils.logger.Logger import d [as 别名]
def getDevicesInfo(self):
'''
获取设备信息
:return: 设备信息字典
'''
__device_info_dic = {}
__device_info = self.shell('getprop').replace('\n','').split('\r')
# __device_info = self.shell('getprop')
print __device_info
for __prop in __device_info:
if __prop.count(':') > 0:
try:
# print("split prop: %s" % __prop)
__prop_key = str(__prop).split(u'[')[1].split(u']')[0]
__prop_value = str(__prop).split(u'[')[2][0:-1]
# __prop_value = str(__prop).split(u':')[1]
except:
print "split prop %s exception" % str(__prop)
else:
continue
if __prop_key == 'dalvik.vm.heapsize':
print __prop
__device_info_dic[DEV_INFO.DEVICES_HEAPSIZE] = __prop_value
Logger.d("Get DEVICES_HEAPSIZE = " + __device_info_dic[DEV_INFO.DEVICES_HEAPSIZE])
if __prop_key == 'ro.build.version.release':
__device_info_dic[DEV_INFO.DEVICES_AND_VERSION] = __prop_value
Logger.d("Get DEVICES_AND _VERSION = " + __device_info_dic[DEV_INFO.DEVICES_AND_VERSION])
if __prop_key == 'ro.build.version.sdk':
__device_info_dic[DEV_INFO.DEVICES_SDK_VERSION] = __prop_value
Logger.d("Get DEVICES_SDK_VERSION = " + __device_info_dic[DEV_INFO.DEVICES_SDK_VERSION])
if __prop_key == 'ro.product.cpu.abi':
__device_info_dic[DEV_INFO.DEVICES_CPU_TYPE] = __prop_value
Logger.d("Get DEVICES_CPU_TYPE = " + __device_info_dic[DEV_INFO.DEVICES_CPU_TYPE])
if __prop_key == 'ro.product.manufacturer':
devices_n1 = __prop_value
if __prop_key == 'ro.product.model':
devices_n2 = __prop_value
try:
__dev_name = str(devices_n1 + '-' + devices_n2).replace(' ','-')
__device_info_dic[DEV_INFO.DEVICES_NAME] = __dev_name
Logger.d("Get DEVICES_NAME = " + __device_info_dic[DEV_INFO.DEVICES_NAME])
except Exception, e:
print "Get device name error"