if PYTHON_VERSION == 3: from queue import Queue else: from Queue import Queue PATH = os.path.abspath( os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) if not PATH in sys.path: sys.path.insert(0, PATH) from stve.exception import * from stve.cmd import run from stve.log import Log from aliez.utility import * MAX_SIZE = 5 L = Log.get(__name__) class PatternMatchObject(object): def __init__(self, _target, _box): self.target = _target self.box = _box def __repr__(self): return "PatternMatchObject()" def __str__(self): return "Target, Box : %s, %s" % (os.path.basename( self.target), self.box)
if not PROFILE_PATH in sys.path: sys.path.insert(0, PROFILE_PATH) from stve.log import Log from stve.cmd import run from stve.exception import * TIMEOUT = 30 UIAUTOMATOR_TIMEOUT = 180 UIAUTOMATOR_PATH = "/data/local/tmp/" ADB_ROOT = os.path.normpath(os.path.dirname(__file__)) ADB_APK_AURA = os.path.join(ADB_ROOT, "apk", "aura") ADB_JAR_AUBS = os.path.join(ADB_ROOT, "jar", "aubs") L = Log("Android.Library.STVE") class AndroidBase(object): def __init__(self, profile, host=PROFILE_PATH): self.WIFI = False self._set_profile(profile, host) def _set_profile(self, name, host): self.profile = None class_name = "_" + name if not os.path.exists(host): L.warning("%s is not exists." % host) raise AndroidError("%s is not exists." % host) try: prof = None