xaal.lib 0.7.9__py3-none-any.whl → 0.7.10__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.
xaal/lib/aioengine.py CHANGED
@@ -36,7 +36,7 @@ class HookType(Enum):
36
36
  class Hook(object):
37
37
  __slots__ = ['type', 'func', 'args', 'kwargs']
38
38
 
39
- def __init__(self, type_:HookType, func: core.FuncT, *args, **kwargs):
39
+ def __init__(self, type_: HookType, func: core.FuncT, *args, **kwargs):
40
40
  # func has to be a callable, but it can be a coroutine or a function
41
41
  self.type = type_
42
42
  self.func = func
@@ -58,7 +58,8 @@ class AsyncEngine(core.EngineMixin):
58
58
  ]
59
59
 
60
60
  def __init__(
61
- self, address: str = config.address, port: int = config.port, hops: int = config.hops, key: bytes = config.key):
61
+ self, address: str = config.address, port: int = config.port, hops: int = config.hops, key: bytes = config.key
62
+ ):
62
63
  core.EngineMixin.__init__(self, address, port, hops, key)
63
64
 
64
65
  self.__txFifo = asyncio.Queue() # tx msg fifo
@@ -167,7 +168,7 @@ class AsyncEngine(core.EngineMixin):
167
168
 
168
169
  async def handle_action_request(self, msg: 'Message', target: 'Device'):
169
170
  if msg.action is None:
170
- return # should not happen, but pyright need this check
171
+ return # should not happen, but pyright need this check
171
172
 
172
173
  try:
173
174
  result = await run_action(msg, target)
@@ -250,7 +251,8 @@ class AsyncEngine(core.EngineMixin):
250
251
  self.new_task(self.receive_task(), name='RecvQ')
251
252
  self.new_task(self.send_task(), name='SendQ')
252
253
  self.new_task(self.timer_task(), name='Timers')
253
- self.new_task(console(locals()), name='Console')
254
+ if config.remote_console:
255
+ self.new_task(console(locals()), name='Console')
254
256
 
255
257
  def setup_alives_timer(self):
256
258
  # needed on stop-start sequence
@@ -259,7 +261,7 @@ class AsyncEngine(core.EngineMixin):
259
261
  # process alives every 10 seconds
260
262
  self.add_timer(self.process_alives, 10)
261
263
 
262
- async def stop(self): # pyright: ignore
264
+ async def stop(self): # pyright: ignore
263
265
  logger.info("Stopping engine")
264
266
  await self.run_hooks(HookType.stop)
265
267
  self.running_event.clear()
@@ -340,7 +342,7 @@ class AsyncEngine(core.EngineMixin):
340
342
  self.dump_hooks()
341
343
 
342
344
  def get_device(self, uuid: UUID) -> Optional['Device']:
343
- # TODO:Check if this method is usefull
345
+ # TODO:Check if this method is usefull
344
346
  for dev in self.devices:
345
347
  if dev.address == uuid:
346
348
  return dev
@@ -391,7 +393,8 @@ async def console(locals=locals(), port: Optional[int] = None):
391
393
  # let's find a free port if not specified
392
394
  def find_free_port():
393
395
  import socketserver
394
- with socketserver.TCPServer(('localhost', 0), None) as s: # pyright: ignore pyright reject the None here
396
+
397
+ with socketserver.TCPServer(('localhost', 0), None) as s: # pyright: ignore pyright reject the None here
395
398
  return s.server_address[1]
396
399
 
397
400
  port = find_free_port()
@@ -407,6 +410,8 @@ async def console(locals=locals(), port: Optional[int] = None):
407
410
  # start the console
408
411
  try:
409
412
  # debian with ipv6 disabled still state that localhost is ::1, which broke aioconsole
410
- await aioconsole.start_interactive_server(host="127.0.0.1", port=port, factory=factory, banner=banner) # pyright: ignore
413
+ await aioconsole.start_interactive_server(
414
+ host="127.0.0.1", port=port, factory=factory, banner=banner
415
+ ) # pyright: ignore
411
416
  except OSError:
412
417
  logger.warning("Unable to run console")
xaal/lib/core.py CHANGED
@@ -56,7 +56,7 @@ class EngineMixin(object):
56
56
  __slots__ = ['devices', 'timers', 'subscribers', 'msg_filter', '_attributesChange', 'network', 'msg_factory']
57
57
 
58
58
  def __init__(self, address: str, port: int, hops: int, key: bytes):
59
- self.devices:list[Device] = [] # list of devices / use (un)register_devices()
59
+ self.devices: list[Device] = [] # list of devices / use (un)register_devices()
60
60
  self.timers: list[Timer] = [] # functions to call periodic
61
61
  self.subscribers: list[SubFuncT] = [] # message receive workflow
62
62
  self.msg_filter = None # message filter
@@ -134,7 +134,7 @@ class EngineMixin(object):
134
134
  self.queue_msg(msg)
135
135
  dev.update_alive()
136
136
 
137
- def send_is_alive(self, dev: 'Device', targets: list = [ALIVE_ADDR,], dev_types: list = ["any.any", ] ):
137
+ def send_is_alive(self, dev: 'Device', targets: list = [ALIVE_ADDR], dev_types: list = ["any.any"]):
138
138
  """Send a is_alive message, w/ dev_types filtering"""
139
139
  body = {'dev_types': dev_types}
140
140
  self.send_request(dev, targets, MessageAction.IS_ALIVE.value, body)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xaal.lib
3
- Version: 0.7.9
3
+ Version: 0.7.10
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,13 +1,13 @@
1
1
  xaal/__init__.py,sha256=jv2YF__bseklT3OWEzlqJ5qE24c4aWd5F4r0TTjOrWQ,65
2
2
  xaal/lib/__init__.py,sha256=yI2lG7uSbedjp1h2FCdcAUGzkyuJxYyNbK13SHvwNew,491
3
3
  xaal/lib/__main__.py,sha256=xsVqqoIh3UeJIXxeexSfmGSUP4YxUcibdZExjEzk4lE,30
4
- xaal/lib/aioengine.py,sha256=3l5wCRV9ZySfJOpKxDD_yO81NtL1v246mMveR28q9ms,13959
4
+ xaal/lib/aioengine.py,sha256=BHCDfr3yVurQj3ePFHyDoBpqqyMuppxLD7OvG6IWgkI,14029
5
5
  xaal/lib/aiohelpers.py,sha256=O1oQX8XHxuvCL1ual509chjoR52AwV_ZGqeAbSlvFrE,1010
6
6
  xaal/lib/aionetwork.py,sha256=WSYwxwEHJaQDlfVocX8ow2tAtssWcH9LxPAazx4Qx_o,2547
7
7
  xaal/lib/bindings.py,sha256=V77bFfeVFj0GyGuwH8b4k7qSyA7zApZYJ8QTjq_3DwI,2140
8
8
  xaal/lib/cbor.py,sha256=XX0zgTU0uwQD9QXctGLT4lEISohi1whMUdyWKMevH8c,1647
9
9
  xaal/lib/config.py,sha256=KR28xC8NGyGjvFD9QcAoWfwyf7xcXDEP7aSenNmaRzM,3019
10
- xaal/lib/core.py,sha256=WUdG1k7H589FpVbTkotHX574KiSYISZ622eWy3Af3B0,11985
10
+ xaal/lib/core.py,sha256=IBTrCCZhBKKYOuZWImxETbLZ5_upH5MRoIKKBXYEXvU,11982
11
11
  xaal/lib/devices.py,sha256=CaUH3i_xTQD0W63fW93glI-Ck2_YVvMpdn8y7BqQqzw,10696
12
12
  xaal/lib/engine.py,sha256=oFiBIma5M6Qv0W2wMmWdyCRuu7BwqR-DRUvqWfajh-A,8141
13
13
  xaal/lib/exceptions.py,sha256=4cKKkDDcZIPyVrLv3Q19apbn_pIqDGqXb1s1d2sZnpI,573
@@ -16,7 +16,7 @@ xaal/lib/messages.py,sha256=FpdIZ5flzUfgXaVVptv_tirvq5jL__mjUGimExwK9Z0,12388
16
16
  xaal/lib/network.py,sha256=oHpyHXkFT31RS6UKMZstC33dgC_sTtYKzfpgugY26oU,3277
17
17
  xaal/lib/test.py,sha256=GTjIwdqRupdqO4lNhAnc4iH0azfCCMN9BEpJpgAUors,2944
18
18
  xaal/lib/tools.py,sha256=Py_RUmLcOVjYDcm7muQ6jZPJLdOKzBfOKstX73K4Jqg,4157
19
- xaal.lib-0.7.9.dist-info/METADATA,sha256=sqdfCDzjK0rQ-rmIYzAoK3-e62injIc0HOgpapB0Fe4,4350
20
- xaal.lib-0.7.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
21
- xaal.lib-0.7.9.dist-info/top_level.txt,sha256=UZ2WDkN02ztkh1OrsjrW8Kmj4n3WqC0BQxaEYOYfWa0,5
22
- xaal.lib-0.7.9.dist-info/RECORD,,
19
+ xaal.lib-0.7.10.dist-info/METADATA,sha256=wnOQJjes_62vU63PL8hKCKsskwSJr8TbBtHY9XZj-IU,4351
20
+ xaal.lib-0.7.10.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
21
+ xaal.lib-0.7.10.dist-info/top_level.txt,sha256=UZ2WDkN02ztkh1OrsjrW8Kmj4n3WqC0BQxaEYOYfWa0,5
22
+ xaal.lib-0.7.10.dist-info/RECORD,,