drb-driver-http 1.2.1__tar.gz → 1.3.0__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.
Files changed (31) hide show
  1. {drb-driver-http-1.2.1/drb_driver_http.egg-info → drb-driver-http-1.3.0}/PKG-INFO +3 -1
  2. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/drivers/http/_version.py +4 -4
  3. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/drivers/http/http.py +11 -44
  4. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0/drb_driver_http.egg-info}/PKG-INFO +3 -1
  5. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb_driver_http.egg-info/requires.txt +1 -1
  6. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/requirements.txt +1 -1
  7. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/LICENCE.txt +0 -0
  8. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/README.md +0 -0
  9. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/drivers/http/__init__.py +0 -0
  10. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/drivers/http/oauth2/HTTPOAuth2.py +0 -0
  11. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/drivers/http/oauth2/__init__.py +0 -0
  12. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/drivers/http/oauth2/oauth2.py +0 -0
  13. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/exceptions/http.py +0 -0
  14. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/topics/http/__init__.py +0 -0
  15. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb/topics/http/cortex.yml +0 -0
  16. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb_driver_http.egg-info/SOURCES.txt +0 -0
  17. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb_driver_http.egg-info/dependency_links.txt +0 -0
  18. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb_driver_http.egg-info/entry_points.txt +0 -0
  19. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb_driver_http.egg-info/not-zip-safe +0 -0
  20. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/drb_driver_http.egg-info/top_level.txt +0 -0
  21. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/pyproject.toml +0 -0
  22. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/setup.cfg +0 -0
  23. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/setup.py +0 -0
  24. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/tests/test_drb_http_basic_auth.py +0 -0
  25. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/tests/test_drb_http_bearer.py +0 -0
  26. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/tests/test_drb_http_factory.py +0 -0
  27. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/tests/test_drb_http_keyring.py +0 -0
  28. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/tests/test_drb_http_signature.py +0 -0
  29. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/tests/test_drb_https_signature.py +0 -0
  30. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/tests/test_drb_impl_http.py +0 -0
  31. {drb-driver-http-1.2.1 → drb-driver-http-1.3.0}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: drb-driver-http
3
- Version: 1.2.1
3
+ Version: 1.3.0
4
4
  Summary: DRB Http driver
5
5
  Author: GAEL Systems
6
6
  Author-email: drb-python@gael.fr
@@ -13,6 +13,8 @@ Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGP
13
13
  Requires-Python: >=3.8
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENCE.txt
16
+ Requires-Dist: drb~=2.2.0
17
+ Requires-Dist: tenacity==8.0.1
16
18
 
17
19
  # Http & Https Implementation
18
20
  This drb-driver-http module implements http and https protocol access with DRB data model.
@@ -1,5 +1,5 @@
1
1
 
2
- # This file was generated by 'versioneer.py' (0.28) from
2
+ # This file was generated by 'versioneer.py' (0.29) from
3
3
  # revision-control system data, or from the parent directory name of an
4
4
  # unpacked source archive. Distribution tarballs contain a pre-generated copy
5
5
  # of this file.
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2023-04-17T09:48:07+0200",
11
+ "date": "2023-09-12T17:43:20+0200",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "33726a58d336a8c50d9a131e48149bfea50b4c01",
15
- "version": "1.2.1"
14
+ "full-revisionid": "38308644bfd44c075f46f5b42c6f3c2daca93a1e",
15
+ "version": "1.3.0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -251,7 +251,7 @@ class DrbHttpNode(AbstractNode):
251
251
  self._auth = auth
252
252
  self._params = params
253
253
  self._children = []
254
- self._available_impl.append(io.BytesIO)
254
+ self.add_impl(io.BytesIO, _to_stream)
255
255
 
256
256
  def __init_header(self):
257
257
  if len(self._attrs) == 0:
@@ -333,43 +333,6 @@ class DrbHttpNode(AbstractNode):
333
333
  raise DrbException(f'Attribute not found name: {name}, '
334
334
  f'namespace: {namespace_uri}')
335
335
 
336
- def get_impl(self, impl: type, **kwargs) -> Any:
337
- """
338
- This operation returns a reference to an object implementing a
339
- specific interface. This method authorizes a specific and/or direct
340
- API instead of using the DrbNode interface. The provided object is
341
- independent of this node and shall be released/closed by the caller
342
- when interface requires such finally operations.
343
-
344
- Parameters:
345
- impl (type): the implementation type expected
346
-
347
- Keyword Arguments:
348
- start (int): The first byte to be downloaded.
349
- end (int): The last byte to be downloaded.
350
-
351
- Return:
352
- Any: the expected implementation.
353
- Raises:
354
- DrbNotImplementedException: if `impl` is not supported by the
355
- current node
356
- """
357
- if self.has_impl(impl):
358
- headers = None
359
- if 'start' in kwargs:
360
- if 'end' in kwargs:
361
- headers = (kwargs.get('start'), kwargs.get('end'))
362
- else:
363
- headers = (kwargs.get('start'),)
364
- return Download(self.path.name,
365
- self.auth,
366
- self.params,
367
- headers,
368
- kwargs.get('chunk_size', 4 * 1048576)
369
- )
370
- raise DrbNotImplementationException(
371
- f'no {impl} implementation found')
372
-
373
336
  @staticmethod
374
337
  def post(url: str,
375
338
  headers: dict = None,
@@ -393,8 +356,16 @@ class DrbHttpNode(AbstractNode):
393
356
  auth=auth)
394
357
  return DrbHttpResponse(path=url, response=response)
395
358
 
396
- def close(self) -> None:
397
- pass
359
+
360
+ def _to_stream(node: DrbHttpNode, **kwargs):
361
+ headers = None
362
+ if 'start' in kwargs:
363
+ if 'end' in kwargs:
364
+ headers = (kwargs.get('start'), kwargs.get('end'))
365
+ else:
366
+ headers = (kwargs.get('start'),)
367
+ return Download(node.path.name, node.auth, node.params, headers,
368
+ kwargs.get('chunk_size', 4 * 1048576))
398
369
 
399
370
 
400
371
  class DrbHttpResponse(DrbHttpNode):
@@ -406,10 +377,6 @@ class DrbHttpResponse(DrbHttpNode):
406
377
  (k, None): v for k, v in self._resp.headers.items()
407
378
  }
408
379
  self.value = response.content
409
- self._available_impl.append(io.BytesIO)
410
-
411
- def get_impl(self, impl: type, **kwargs) -> Any:
412
- return io.BytesIO(self._resp.content)
413
380
 
414
381
 
415
382
  class DrbHttpFactory(DrbFactory):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: drb-driver-http
3
- Version: 1.2.1
3
+ Version: 1.3.0
4
4
  Summary: DRB Http driver
5
5
  Author: GAEL Systems
6
6
  Author-email: drb-python@gael.fr
@@ -13,6 +13,8 @@ Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGP
13
13
  Requires-Python: >=3.8
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENCE.txt
16
+ Requires-Dist: drb~=2.2.0
17
+ Requires-Dist: tenacity==8.0.1
16
18
 
17
19
  # Http & Https Implementation
18
20
  This drb-driver-http module implements http and https protocol access with DRB data model.
@@ -1,2 +1,2 @@
1
- drb~=2.1.3
1
+ drb~=2.2.0
2
2
  tenacity==8.0.1
@@ -1,2 +1,2 @@
1
- drb~=2.1.3
1
+ drb~=2.2.0
2
2
  tenacity==8.0.1