Remove redundant code
This commit is contained in:
parent
1c84277af1
commit
3a21f61559
|
@ -159,12 +159,12 @@ class AgoraDesk:
|
||||||
"""
|
"""
|
||||||
return self._api_call(api_method=f"account_info/{username}")
|
return self._api_call(api_method=f"account_info/{username}")
|
||||||
|
|
||||||
def dashboard(self) -> Dict[str, Any]:
|
# def dashboard(self) -> Dict[str, Any]:
|
||||||
"""See Agoradesk API.
|
# """See Agoradesk API.
|
||||||
|
|
||||||
https://agoradesk.com/api-docs/v1#operation/getUserDashboard
|
# https://agoradesk.com/api-docs/v1#operation/getUserDashboard
|
||||||
"""
|
# """
|
||||||
return self._api_call(api_method="dashboard")
|
# return self._api_call(api_method="dashboard")
|
||||||
|
|
||||||
def dashboard_buyer(self) -> Dict[str, Any]:
|
def dashboard_buyer(self) -> Dict[str, Any]:
|
||||||
"""See Agoradesk API.
|
"""See Agoradesk API.
|
||||||
|
@ -173,7 +173,7 @@ class AgoraDesk:
|
||||||
"""
|
"""
|
||||||
return self._api_call(api_method="dashboard/buyer")
|
return self._api_call(api_method="dashboard/buyer")
|
||||||
|
|
||||||
def dashboard_seller(self) -> Dict[str, Any]:
|
def dashboard(self) -> Dict[str, Any]:
|
||||||
"""See Agoradesk API.
|
"""See Agoradesk API.
|
||||||
|
|
||||||
https://agoradesk.com/api-docs/v1#operation/getUserDashboardSeller
|
https://agoradesk.com/api-docs/v1#operation/getUserDashboardSeller
|
||||||
|
|
|
@ -188,37 +188,6 @@ class LocalBitcoins:
|
||||||
response.addCallback(self.callback_api_call, result)
|
response.addCallback(self.callback_api_call, result)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
session = requests.Session()
|
|
||||||
try:
|
|
||||||
response = session.send(api_request)
|
|
||||||
response_json = response.json()
|
|
||||||
result["response"] = response_json
|
|
||||||
result["status"] = response.status_code
|
|
||||||
if response.status_code == 200:
|
|
||||||
result["success"] = True
|
|
||||||
result["message"] = "OK"
|
|
||||||
else:
|
|
||||||
result["message"] = "API ERROR"
|
|
||||||
return result
|
|
||||||
|
|
||||||
except requests.ConnectionError as error:
|
|
||||||
result["message"] = str(error)
|
|
||||||
result["status"] = 600
|
|
||||||
result["response"] = {"error": {"message": error}}
|
|
||||||
return result
|
|
||||||
except json.decoder.JSONDecodeError:
|
|
||||||
result["message"] = "Not JSON"
|
|
||||||
if response:
|
|
||||||
result["status"] = response.status_code
|
|
||||||
result["response"] = {"error": {"message": response.text}}
|
|
||||||
return result
|
|
||||||
except requests.ReadTimeout:
|
|
||||||
result["message"] = "Read timed out"
|
|
||||||
if response:
|
|
||||||
result["status"] = response.status_code
|
|
||||||
result["response"] = {"error": {"message": response.text}}
|
|
||||||
return result
|
|
||||||
|
|
||||||
# Account related API Methods
|
# Account related API Methods
|
||||||
# ===========================
|
# ===========================
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue