Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"mainActivity": "com.github.uiautomator.MainActivity",
"label": "ATX",
"versionName": "1.1.7",
"versionCode": 1001007,
"size":1760809
}
Raises:
UiaError
"""
url = self.path2url('/packages/{0}/info'.format(pkg_name))
resp = self._reqsess.get(url)
resp.raise_for_status()
resp = resp.json()
if not resp.get('success'):
raise BaseError(resp.get('description', 'unknown'))
return resp.get('data')
import json
class BaseError(Exception):
pass
class RetryError(BaseError):
""" retry when meet this error """
class SessionBrokenError(BaseError):
""" only happens when app quit or crash """
class UiautomatorQuitError(BaseError):
pass
class ConnectError(BaseError):
pass
class XPathElementNotFoundError(BaseError):
pass
class GatewayError(BaseError):
def __init__(self, response, description):
self.response = response
self.description = description
class XPathElementNotFoundError(BaseError):
pass
class GatewayError(BaseError):
def __init__(self, response, description):
self.response = response
self.description = description
def __str__(self):
return "uiautomator2.GatewayError(" + self.description + ")"
class JsonRpcError(BaseError):
@staticmethod
def format_errcode(errcode):
m = {
-32700: 'Parse error',
-32600: 'Invalid Request',
-32601: 'Method not found',
-32602: 'Invalid params',
-32603: 'Internal error',
-32001: 'Jsonrpc error',
-32002: 'Client error',
}
if errcode in m:
return m[errcode]
if errcode >= -32099 and errcode <= -32000:
return 'Server error'
return 'Unknown error'
# coding: utf-8
#
# class ATXError(Exception):
# pass
import json
class BaseError(Exception):
pass
class RetryError(BaseError):
""" retry when meet this error """
class SessionBrokenError(BaseError):
""" only happens when app quit or crash """
class UiautomatorQuitError(BaseError):
pass
class ConnectError(BaseError):
pass
class XPathElementNotFoundError(BaseError):
""" only happens when app quit or crash """
class UiautomatorQuitError(BaseError):
pass
class ConnectError(BaseError):
pass
class XPathElementNotFoundError(BaseError):
pass
class GatewayError(BaseError):
def __init__(self, response, description):
self.response = response
self.description = description
def __str__(self):
return "uiautomator2.GatewayError(" + self.description + ")"
class JsonRpcError(BaseError):
@staticmethod
def format_errcode(errcode):
m = {
-32700: 'Parse error',
-32600: 'Invalid Request',
-32601: 'Method not found',
-32602: 'Invalid params',
# class ATXError(Exception):
# pass
import json
class BaseError(Exception):
pass
class RetryError(BaseError):
""" retry when meet this error """
class SessionBrokenError(BaseError):
""" only happens when app quit or crash """
class UiautomatorQuitError(BaseError):
pass
class ConnectError(BaseError):
pass
class XPathElementNotFoundError(BaseError):
pass
class GatewayError(BaseError):
pass
class RetryError(BaseError):
""" retry when meet this error """
class SessionBrokenError(BaseError):
""" only happens when app quit or crash """
class UiautomatorQuitError(BaseError):
pass
class ConnectError(BaseError):
pass
class XPathElementNotFoundError(BaseError):
pass
class GatewayError(BaseError):
def __init__(self, response, description):
self.response = response
self.description = description
def __str__(self):
return "uiautomator2.GatewayError(" + self.description + ")"
""" retry when meet this error """
class SessionBrokenError(BaseError):
""" only happens when app quit or crash """
class UiautomatorQuitError(BaseError):
pass
class ConnectError(BaseError):
pass
class XPathElementNotFoundError(BaseError):
pass
class GatewayError(BaseError):
def __init__(self, response, description):
self.response = response
self.description = description
def __str__(self):
return "uiautomator2.GatewayError(" + self.description + ")"
class JsonRpcError(BaseError):
@staticmethod
def format_errcode(errcode):
m = {