ellipsis 3.1.42__py3-none-any.whl → 3.1.43__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ellipsis might be problematic. Click here for more details.
- ellipsis/__init__.py +1 -1
- ellipsis/apiManager.py +33 -17
- {ellipsis-3.1.42.dist-info → ellipsis-3.1.43.dist-info}/METADATA +1 -1
- {ellipsis-3.1.42.dist-info → ellipsis-3.1.43.dist-info}/RECORD +7 -7
- {ellipsis-3.1.42.dist-info → ellipsis-3.1.43.dist-info}/LICENSE +0 -0
- {ellipsis-3.1.42.dist-info → ellipsis-3.1.43.dist-info}/WHEEL +0 -0
- {ellipsis-3.1.42.dist-info → ellipsis-3.1.43.dist-info}/top_level.txt +0 -0
ellipsis/__init__.py
CHANGED
ellipsis/apiManager.py
CHANGED
|
@@ -2,6 +2,7 @@ import requests
|
|
|
2
2
|
import json
|
|
3
3
|
import urllib
|
|
4
4
|
import os
|
|
5
|
+
import time
|
|
5
6
|
from requests_toolbelt import MultipartEncoder
|
|
6
7
|
|
|
7
8
|
baseUrl = 'https://api.ellipsis-drive.com/v3'
|
|
@@ -65,8 +66,36 @@ def delete(url, body, token = None):
|
|
|
65
66
|
r = call( method = requests.delete, url = url, body = body, token = token )
|
|
66
67
|
return r
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
RETRIES = 10
|
|
70
|
+
WAIT = 2
|
|
69
71
|
def call(method, url, body = None, token = None, crash = True, parseJson = True):
|
|
72
|
+
tried = 0
|
|
73
|
+
while tried <RETRIES:
|
|
74
|
+
try:
|
|
75
|
+
r = actualCall(method, url, body, token)
|
|
76
|
+
break
|
|
77
|
+
except:
|
|
78
|
+
print('time out detected, retrying request')
|
|
79
|
+
time.sleep(WAIT)
|
|
80
|
+
tried = tried +1
|
|
81
|
+
if tried >= RETRIES:
|
|
82
|
+
raise ValueError('Could not reach server')
|
|
83
|
+
if crash:
|
|
84
|
+
if r.status_code != 200:
|
|
85
|
+
raise ValueError(r.text)
|
|
86
|
+
|
|
87
|
+
if parseJson:
|
|
88
|
+
try:
|
|
89
|
+
r = r.json()
|
|
90
|
+
except:
|
|
91
|
+
r = r.text
|
|
92
|
+
|
|
93
|
+
return r
|
|
94
|
+
else:
|
|
95
|
+
return r
|
|
96
|
+
|
|
97
|
+
TIMEOUTTIME = 10
|
|
98
|
+
def actualCall(method, url, body, token):
|
|
70
99
|
body = filterNone(body)
|
|
71
100
|
if type(body) != type(None) and type(body) != type({}):
|
|
72
101
|
raise ValueError(
|
|
@@ -76,26 +105,13 @@ def call(method, url, body = None, token = None, crash = True, parseJson = True)
|
|
|
76
105
|
raise ValueError('Token must be of type string or noneType')
|
|
77
106
|
|
|
78
107
|
if token == None:
|
|
79
|
-
r = method(baseUrl + url, json=body)
|
|
108
|
+
r = method(baseUrl + url, json=body, timeout=TIMEOUTTIME)
|
|
80
109
|
else:
|
|
81
110
|
if not 'Bearer' in token:
|
|
82
111
|
token = 'Bearer ' + token
|
|
83
|
-
r = method(baseUrl + url
|
|
84
|
-
|
|
85
|
-
if crash:
|
|
86
|
-
if r.status_code != 200:
|
|
87
|
-
raise ValueError(r.text)
|
|
88
|
-
|
|
89
|
-
if parseJson:
|
|
90
|
-
try:
|
|
91
|
-
r = r.json()
|
|
92
|
-
except:
|
|
93
|
-
r = r.text
|
|
94
|
-
|
|
95
|
-
return r
|
|
96
|
-
else:
|
|
97
|
-
return r
|
|
112
|
+
r = method(baseUrl + url, json=body, headers={"Authorization": token}, timeout=TIMEOUTTIME)
|
|
98
113
|
|
|
114
|
+
return r
|
|
99
115
|
|
|
100
116
|
def upload(url, filePath, body, token, key = 'data', memfile= None):
|
|
101
117
|
body = filterNone(body, toString=True)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
ellipsis/__init__.py,sha256=
|
|
2
|
-
ellipsis/apiManager.py,sha256=
|
|
1
|
+
ellipsis/__init__.py,sha256=hwn8DtT6nLrwlH8pbEUxoG8aWix5UfD8tLpnwPH_hho,236
|
|
2
|
+
ellipsis/apiManager.py,sha256=hfe-pESfrljoY9Q_86G1kDYbBW9i3_xMNmh5zN0jRd0,5485
|
|
3
3
|
ellipsis/sanitize.py,sha256=T5FawJRZ2eqGv0itiMkZ1fuJpahsSyhBMFty9cG-wwA,10194
|
|
4
4
|
ellipsis/account/__init__.py,sha256=K40DMBaUDSxt3rO2WZv63Wmpfy49ocqBxvWqyIYHR24,92
|
|
5
5
|
ellipsis/account/root.py,sha256=tgGAT2BzP3zgAqsevvkeognn5S67T-MrIP52BLN9rbE,1791
|
|
@@ -63,8 +63,8 @@ ellipsis/util/__init__.py,sha256=G0LaqqipkJXqZZnW78pqOw-gDQWZYLMa2ioLoCac-NI,714
|
|
|
63
63
|
ellipsis/util/root.py,sha256=keGn515Dnxyja8kNG9p-xdsX6gRa8pHCh6AJaQXLoig,23445
|
|
64
64
|
ellipsis/view/__init__.py,sha256=91KyJzbSvwSP9hvJQyo1LLM48b5NixLz6G40I9h6sdY,67
|
|
65
65
|
ellipsis/view/root.py,sha256=6actiBwIsM0f7sJhQl_U4j-C6Dhe0z5XGGtxIOIKdY8,1726
|
|
66
|
-
ellipsis-3.1.
|
|
67
|
-
ellipsis-3.1.
|
|
68
|
-
ellipsis-3.1.
|
|
69
|
-
ellipsis-3.1.
|
|
70
|
-
ellipsis-3.1.
|
|
66
|
+
ellipsis-3.1.43.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
|
67
|
+
ellipsis-3.1.43.dist-info/METADATA,sha256=YvBY9loQarcjjz1Gt4eeTRGhO8RkDKMIGN7UNu7LI5Q,1823
|
|
68
|
+
ellipsis-3.1.43.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
69
|
+
ellipsis-3.1.43.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
|
|
70
|
+
ellipsis-3.1.43.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|