Example #1
0
File: camera.py Project: rfhy/py
# -*- coding: UTF-8 -*-

import os,time,sys
from useriface import device
from useriface import logger
from useriface import hostpc
from datetime import datetime
from sendemail_attach_import import Sendmail
import multiprocessing

#SN = '192.168.40.133:5555'
SN = '0123456789ABCDEF'
dev = device.Device(SN)
ui = dev.uidevice
pc = hostpc.Host(SN)
log = logger.Logger(__file__)


def Logfile():

    curtime0 = datetime.now().strftime('%Y%m%d_%H%M%S')

    global file1
    file1 = curtime0 +'_camera.log'
    log1 = log.addLog2file(file1)


#待机唤醒,进入applist,打开相机,拍照,进入图库,删除刚刚拍摄的照片,返回Home,待机


def WatcherRun():
Example #2
0
File: wifi_ping.py Project: rfhy/py
import os, sys, time
from datetime import datetime

from useriface import device
from useriface import hostpc
from useriface import logger

import multiprocessing

sn = 'testmode'
#sn = '50a99b07'

dev = device.Device(sn)
ui = dev.uidevice
pc = hostpc.Host(sn)
log = logger.Logger(__file__)
log.addLog2file('8909_wifi_ping.log')

count = 60

on = ui(packageName='com.android.settings', text=u'关闭')
off = ui(packageName='com.android.settings', text=u'开启')


def Gowifi():

    log.info("open settings")
    os.popen("adb -s " + sn + " shell am start com.android.settings/.Settings")
    time.sleep(5)
    wifi = ui(packageName='com.android.settings', text='WLAN')