pytolino 1.5__tar.gz → 1.6__tar.gz
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.
- {pytolino-1.5/src/pytolino.egg-info → pytolino-1.6}/PKG-INFO +3 -2
- {pytolino-1.5 → pytolino-1.6}/pyproject.toml +1 -1
- {pytolino-1.5 → pytolino-1.6}/src/pytolino/tolino_cloud.py +14 -1
- {pytolino-1.5 → pytolino-1.6/src/pytolino.egg-info}/PKG-INFO +3 -2
- {pytolino-1.5 → pytolino-1.6}/tests/test_tolino_cloud.py +3 -3
- {pytolino-1.5 → pytolino-1.6}/LICENSE +0 -0
- {pytolino-1.5 → pytolino-1.6}/MANIFEST.in +0 -0
- {pytolino-1.5 → pytolino-1.6}/README.rst +0 -0
- {pytolino-1.5 → pytolino-1.6}/setup.cfg +0 -0
- {pytolino-1.5 → pytolino-1.6}/src/pytolino/__init__.py +0 -0
- {pytolino-1.5 → pytolino-1.6}/src/pytolino/servers_settings.ini +0 -0
- {pytolino-1.5 → pytolino-1.6}/src/pytolino.egg-info/SOURCES.txt +0 -0
- {pytolino-1.5 → pytolino-1.6}/src/pytolino.egg-info/dependency_links.txt +0 -0
- {pytolino-1.5 → pytolino-1.6}/src/pytolino.egg-info/requires.txt +0 -0
- {pytolino-1.5 → pytolino-1.6}/src/pytolino.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pytolino
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6
|
|
4
4
|
Summary: client for tolino cloud
|
|
5
5
|
Author: Imam Usmani
|
|
6
6
|
Project-URL: Source Code, https://github.com/ImamAzim/pytolino
|
|
@@ -23,6 +23,7 @@ Requires-Dist: sphinx; extra == "dev"
|
|
|
23
23
|
Requires-Dist: build; extra == "dev"
|
|
24
24
|
Requires-Dist: twine; extra == "dev"
|
|
25
25
|
Requires-Dist: sphinx-rtd-theme; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
26
27
|
|
|
27
28
|
pytolino
|
|
28
29
|
===================
|
|
@@ -6,11 +6,13 @@ import configparser
|
|
|
6
6
|
import platform
|
|
7
7
|
import logging
|
|
8
8
|
from urllib.parse import urlparse, parse_qs
|
|
9
|
+
from urllib3.util import Retry
|
|
9
10
|
import json
|
|
10
11
|
import time
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
import requests
|
|
15
|
+
from requests.adapters import HTTPAdapter
|
|
14
16
|
import mechanize
|
|
15
17
|
|
|
16
18
|
|
|
@@ -27,6 +29,8 @@ servers_settings = configparser.ConfigParser()
|
|
|
27
29
|
servers_settings.read(SERVERS_SETTINGS_FILE_PATH)
|
|
28
30
|
|
|
29
31
|
PARTNERS = servers_settings.sections()
|
|
32
|
+
TOTAL_RETRY =5
|
|
33
|
+
STATUS_FORCELIST = [404]
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
def main():
|
|
@@ -124,7 +128,15 @@ class Client(object):
|
|
|
124
128
|
self.token_expires = None
|
|
125
129
|
|
|
126
130
|
self.server_settings = servers_settings[server_name]
|
|
127
|
-
self.session = requests.
|
|
131
|
+
self.session = requests.Session()
|
|
132
|
+
retry_strategy = Retry(
|
|
133
|
+
total=TOTAL_RETRY,
|
|
134
|
+
status_forcelist=STATUS_FORCELIST,
|
|
135
|
+
backoff_factor=2,
|
|
136
|
+
allowed_methods=frozenset(['GET', 'POST']))
|
|
137
|
+
adapter = HTTPAdapter(max_retries=retry_strategy)
|
|
138
|
+
self.session.mount('http://', adapter)
|
|
139
|
+
self.session.mount('https://', adapter)
|
|
128
140
|
self.browser = mechanize.Browser()
|
|
129
141
|
self.browser.set_handle_robots(False)
|
|
130
142
|
self.server_name = server_name
|
|
@@ -196,6 +208,7 @@ class Client(object):
|
|
|
196
208
|
allow_redirects=False,
|
|
197
209
|
)
|
|
198
210
|
self._log_requests(host_response)
|
|
211
|
+
|
|
199
212
|
try:
|
|
200
213
|
j = host_response.json()
|
|
201
214
|
self.access_token = j['access_token']
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pytolino
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6
|
|
4
4
|
Summary: client for tolino cloud
|
|
5
5
|
Author: Imam Usmani
|
|
6
6
|
Project-URL: Source Code, https://github.com/ImamAzim/pytolino
|
|
@@ -23,6 +23,7 @@ Requires-Dist: sphinx; extra == "dev"
|
|
|
23
23
|
Requires-Dist: build; extra == "dev"
|
|
24
24
|
Requires-Dist: twine; extra == "dev"
|
|
25
25
|
Requires-Dist: sphinx-rtd-theme; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
26
27
|
|
|
27
28
|
pytolino
|
|
28
29
|
===================
|
|
@@ -238,12 +238,12 @@ def add_cover_test():
|
|
|
238
238
|
|
|
239
239
|
|
|
240
240
|
if __name__ == '__main__':
|
|
241
|
-
|
|
241
|
+
logging.basicConfig(level=logging.INFO)
|
|
242
242
|
# register_test()
|
|
243
243
|
# unregister_test()
|
|
244
|
-
|
|
244
|
+
client_method_tests()
|
|
245
245
|
# upload_test()
|
|
246
246
|
# delete_test()
|
|
247
247
|
# add_cover_test()
|
|
248
248
|
# metadata_test()
|
|
249
|
-
inventory_test()
|
|
249
|
+
# inventory_test()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|