Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def plugin_clear():
Device.plugins().clear()
def plugins():
return Device.__plugins
Raises:
ConnectError
Examples:
connect_wifi("10.0.0.1")
"""
if not re.match(r"^https?://", addr):
addr = "http://" + addr
# fixed_addr = fix_wifi_addr(addr)
# if fixed_addr is None:
# raise ConnectError("addr is invalid or atx-agent is not running", addr)
u = urlparse.urlparse(addr)
host = u.hostname
port = u.port or 7912
return Device(host, port)
if x < 1:
x = x * w
if y < 1:
y = y * h
return (x, y)
def swipe(self, x0, y0, x1, y1):
w, h = None, None
if x0 < 1 or y0 < 1 or x1 < 1 or y1 < 1:
w, h = self.wmsize()
x0, y0 = self._adjust_pos(x0, y0, w, h)
x1, y1 = self._adjust_pos(x1, y1, w, h)
self.shell("input swipe %d %d %d %d" % (x0, y0, x1, y1))
UIAutomatorServer = Device # Deprecated UIAutomatorServer