xaal.lib 0.7.3__tar.gz → 0.7.5__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 (33) hide show
  1. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/PKG-INFO +1 -1
  2. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/pyproject.toml +1 -1
  3. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/cbor.py +7 -13
  4. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/messages.py +3 -3
  5. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal.lib.egg-info/PKG-INFO +1 -1
  6. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/README.rst +0 -0
  7. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/setup.cfg +0 -0
  8. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/tests/test_bindings.py +0 -0
  9. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/tests/test_cbor.py +0 -0
  10. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/tests/test_device.py +0 -0
  11. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/tests/test_engine.py +0 -0
  12. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/tests/test_message.py +0 -0
  13. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/tests/test_tools.py +0 -0
  14. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/__init__.py +0 -0
  15. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/__init__.py +0 -0
  16. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/__main__.py +0 -0
  17. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/aioengine.py +0 -0
  18. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/aiohelpers.py +0 -0
  19. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/aionetwork.py +0 -0
  20. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/bindings.py +0 -0
  21. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/config.py +0 -0
  22. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/core.py +0 -0
  23. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/devices.py +0 -0
  24. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/engine.py +0 -0
  25. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/exceptions.py +0 -0
  26. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/helpers.py +0 -0
  27. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/network.py +0 -0
  28. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/test.py +0 -0
  29. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal/lib/tools.py +0 -0
  30. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal.lib.egg-info/SOURCES.txt +0 -0
  31. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal.lib.egg-info/dependency_links.txt +0 -0
  32. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal.lib.egg-info/requires.txt +0 -0
  33. {xaal_lib-0.7.3 → xaal_lib-0.7.5}/xaal.lib.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xaal.lib
3
- Version: 0.7.3
3
+ Version: 0.7.5
4
4
  Summary: Official Python stack for xAAL protocol
5
5
  Author-email: Jerome Kerdreux <Jerome.Kerdreux@imt-atlantique.fr>
6
6
  License: GPL License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "xaal.lib"
3
- version = "0.7.3"
3
+ version = "0.7.5"
4
4
  description = "Official Python stack for xAAL protocol"
5
5
  readme = "README.rst"
6
6
  authors = [
@@ -1,13 +1,12 @@
1
1
  from io import BytesIO
2
2
  import cbor2
3
3
  from cbor2 import CBORTag
4
- from cbor2 import CBORDecoder
5
- # from cbor2.decoder import CBORDecoder
4
+ from cbor2.decoder import CBORDecoder
6
5
 
7
6
  from . import bindings
8
7
 
9
8
  # ugly patch to remove default UUID decodeur
10
- cbor2._decoder.semantic_decoders.pop(37)
9
+ cbor2.decoder.semantic_decoders.pop(37)
11
10
 
12
11
 
13
12
  def tag_hook(decoder, tag, shareable_index=None):
@@ -17,11 +16,6 @@ def tag_hook(decoder, tag, shareable_index=None):
17
16
  return bindings.URL(tag.value)
18
17
  return tag
19
18
 
20
- def object_hook(decoder, data):
21
- #print("hook [%s]" % data)
22
- return data
23
-
24
-
25
19
  def default_encoder(encoder, value):
26
20
  if isinstance(value,bindings.UUID):
27
21
  encoder.encode(CBORTag(37, value.bytes))
@@ -34,7 +28,7 @@ def dumps(obj, **kwargs):
34
28
 
35
29
  def loads(payload, **kwargs):
36
30
  #return cbor2.loads(payload,tag_hook=tag_hook,**kwargs)
37
- return _loads(payload,tag_hook=tag_hook,object_hook=object_hook,**kwargs)
31
+ return _loads(payload,tag_hook=tag_hook,**kwargs)
38
32
 
39
33
  def _loads(s, **kwargs):
40
34
  with BytesIO(s) as fp:
@@ -44,16 +38,16 @@ def _loads(s, **kwargs):
44
38
 
45
39
 
46
40
  def cleanup(obj):
47
- """
41
+ """
48
42
  recursive walk a object to search for un-wanted CBOR tags.
49
43
  Transform this tag in string format, this can be UUID, URL..
50
- Should be Ok, with list, dicts..
51
- Warning: This operate in-place changes.
44
+ Should be Ok, with list, dicts..
45
+ Warning: This operate in-place changes.
52
46
  Warning: This won't work for tags in dict keys.
53
47
  """
54
48
  if isinstance(obj,list):
55
49
  for i in range(0,len(obj)):
56
- obj[i] = cleanup(obj[i])
50
+ obj[i] = cleanup(obj[i])
57
51
  return obj
58
52
 
59
53
  if isinstance(obj,dict):
@@ -210,7 +210,7 @@ class MessageFactory(object):
210
210
  class MessageType(Enum):
211
211
  NOTIFY = 0
212
212
  REQUEST = 1
213
- REPLY = 2
213
+ REPLY = 2
214
214
 
215
215
 
216
216
  class MessageAction(Enum):
@@ -323,8 +323,8 @@ def build_nonce(data):
323
323
 
324
324
  def build_timestamp():
325
325
  """Return array [seconds since epoch, microseconds since last seconds] Time = UTC+0000"""
326
- epoch = datetime.datetime.utcfromtimestamp(0)
327
- timestamp = datetime.datetime.utcnow() - epoch
326
+ epoch = datetime.datetime.fromtimestamp(0, datetime.UTC)
327
+ timestamp = datetime.datetime.now(datetime.UTC) - epoch
328
328
  return _packtimestamp(timestamp.total_seconds(), timestamp.microseconds)
329
329
 
330
330
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xaal.lib
3
- Version: 0.7.3
3
+ Version: 0.7.5
4
4
  Summary: Official Python stack for xAAL protocol
5
5
  Author-email: Jerome Kerdreux <Jerome.Kerdreux@imt-atlantique.fr>
6
6
  License: GPL License
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
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