xaal.lib 0.7.10__py3-none-any.whl → 0.7.12__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 +1 -2
- xaal/lib/config.py +8 -5
- xaal/lib/devices.py +3 -3
- xaal/lib/helpers.py +5 -4
- {xaal.lib-0.7.10.dist-info → xaal_lib-0.7.12.dist-info}/METADATA +5 -5
- {xaal.lib-0.7.10.dist-info → xaal_lib-0.7.12.dist-info}/RECORD +8 -8
- {xaal.lib-0.7.10.dist-info → xaal_lib-0.7.12.dist-info}/WHEEL +1 -1
- {xaal.lib-0.7.10.dist-info → xaal_lib-0.7.12.dist-info}/top_level.txt +0 -0
xaal/lib/aioengine.py
CHANGED
|
@@ -268,9 +268,8 @@ class AsyncEngine(core.EngineMixin):
|
|
|
268
268
|
self.started_event.clear()
|
|
269
269
|
# cancel all tasks
|
|
270
270
|
for task in self.all_tasks():
|
|
271
|
-
if task != self._watchdog_task:
|
|
271
|
+
if task != self._watchdog_task and not task.cancelled():
|
|
272
272
|
task.cancel()
|
|
273
|
-
await asyncio.sleep(0.1)
|
|
274
273
|
|
|
275
274
|
def sigkill_handler(self, signal, frame):
|
|
276
275
|
print("", end="\r") # remove the uggly ^C
|
xaal/lib/config.py
CHANGED
|
@@ -87,9 +87,12 @@ class Config:
|
|
|
87
87
|
return False
|
|
88
88
|
|
|
89
89
|
|
|
90
|
+
config_dir = os.environ.get("XAAL_CONF_DIR", None)
|
|
90
91
|
config = Config()
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
|
|
93
|
+
if config_dir is None or config_dir != '':
|
|
94
|
+
try:
|
|
95
|
+
config.load()
|
|
96
|
+
except Exception as e:
|
|
97
|
+
print(e)
|
|
98
|
+
sys.exit(-1)
|
xaal/lib/devices.py
CHANGED
|
@@ -247,21 +247,21 @@ class Device(object):
|
|
|
247
247
|
r.append(['address', self.address])
|
|
248
248
|
for k, v in self._get_description().items():
|
|
249
249
|
r.append([k, v])
|
|
250
|
-
print(tabulate(r, tablefmt='
|
|
250
|
+
print(tabulate(r, tablefmt='psql'))
|
|
251
251
|
|
|
252
252
|
# attributes
|
|
253
253
|
if len(self._get_attributes()) > 0:
|
|
254
254
|
r = []
|
|
255
255
|
for k, v in self._get_attributes().items():
|
|
256
256
|
r.append([k, str(v)])
|
|
257
|
-
print(tabulate(r, tablefmt='
|
|
257
|
+
print(tabulate(r, tablefmt='psql'))
|
|
258
258
|
|
|
259
259
|
# methods
|
|
260
260
|
if len(self.methods) > 0:
|
|
261
261
|
r = []
|
|
262
262
|
for k, v in self.methods.items():
|
|
263
263
|
r.append([k, v.__name__])
|
|
264
|
-
print(tabulate(r, tablefmt='
|
|
264
|
+
print(tabulate(r, tablefmt='psql'))
|
|
265
265
|
|
|
266
266
|
def __repr__(self) -> str:
|
|
267
267
|
return f"<xaal.Device {id(self):x} {self.address} {self.dev_type}>"
|
xaal/lib/helpers.py
CHANGED
|
@@ -7,7 +7,7 @@ import logging
|
|
|
7
7
|
import logging.handlers
|
|
8
8
|
import os
|
|
9
9
|
import time
|
|
10
|
-
from typing import Any, Optional
|
|
10
|
+
from typing import Any, Optional, Union
|
|
11
11
|
|
|
12
12
|
import coloredlogs
|
|
13
13
|
from decorator import decorator
|
|
@@ -41,13 +41,14 @@ def set_console_title(value: str):
|
|
|
41
41
|
print("\x1b]0;xAAL => %s\x07" % value, end="\r")
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
def setup_console_logger(level: str = config.log_level):
|
|
45
|
-
fmt = "%(asctime)s %(name)-25s %(funcName)-18s %(levelname)-8s %(message)s"
|
|
44
|
+
def setup_console_logger(level: Union[str, int] = config.log_level):
|
|
45
|
+
# fmt = "%(asctime)s %(name)-25s %(funcName)-18s %(levelname)-8s %(message)s"
|
|
46
|
+
fmt = "%(asctime)s %(name)-25s %(funcName)-18s %(message)s"
|
|
46
47
|
# fmt = '[%(name)s] %(funcName)s %(levelname)s: %(message)s'
|
|
47
48
|
coloredlogs.install(level=level, fmt=fmt)
|
|
48
49
|
|
|
49
50
|
|
|
50
|
-
def setup_file_logger(name: str, level: str = config.log_level, filename: Optional[str] = None):
|
|
51
|
+
def setup_file_logger(name: str, level: Union[str, int] = config.log_level, filename: Optional[str] = None):
|
|
51
52
|
filename = filename or os.path.join(config.log_path, "%s.log" % name)
|
|
52
53
|
formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(name)s - %(message)s")
|
|
53
54
|
handler = logging.handlers.RotatingFileHandler(filename, "a", 10000, 1, "utf8")
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: xaal.lib
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.12
|
|
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
|
|
7
|
-
Project-URL: Homepage, https://
|
|
8
|
-
Project-URL: Documentation, https://
|
|
9
|
-
Project-URL: Source, https://
|
|
7
|
+
Project-URL: Homepage, https://gitlab.imt-atlantique.fr/xaal/code/python/-/blob/main/packages.rst
|
|
8
|
+
Project-URL: Documentation, https://gitlab.imt-atlantique.fr/xaal/code/python/-/blob/main/libs/lib/README.rst
|
|
9
|
+
Project-URL: Source, https://gitlab.imt-atlantique.fr/xaal/code/python/-/tree/main/libs/lib
|
|
10
10
|
Keywords: xaal,home-automation
|
|
11
11
|
Classifier: Programming Language :: Python
|
|
12
12
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
@@ -1,22 +1,22 @@
|
|
|
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=
|
|
4
|
+
xaal/lib/aioengine.py,sha256=rMFQJgPVtqkCkQAJFM2y4AQucbxr7riUFkb0QWO3asg,14013
|
|
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
|
-
xaal/lib/config.py,sha256=
|
|
9
|
+
xaal/lib/config.py,sha256=cKI2XvyN2rNFOBQCMithigHa72hbnDjV4aOrc2ws7io,3134
|
|
10
10
|
xaal/lib/core.py,sha256=IBTrCCZhBKKYOuZWImxETbLZ5_upH5MRoIKKBXYEXvU,11982
|
|
11
|
-
xaal/lib/devices.py,sha256=
|
|
11
|
+
xaal/lib/devices.py,sha256=KnmZvn_WJNqhMTlNPp5UTrHHAuwXdZwiJlQCMDhH2UM,10678
|
|
12
12
|
xaal/lib/engine.py,sha256=oFiBIma5M6Qv0W2wMmWdyCRuu7BwqR-DRUvqWfajh-A,8141
|
|
13
13
|
xaal/lib/exceptions.py,sha256=4cKKkDDcZIPyVrLv3Q19apbn_pIqDGqXb1s1d2sZnpI,573
|
|
14
|
-
xaal/lib/helpers.py,sha256=
|
|
14
|
+
xaal/lib/helpers.py,sha256=eq6IyiVAvr4GViaZYMDgjB9c4_p4cRoymueNpWY4qIQ,2924
|
|
15
15
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
xaal_lib-0.7.12.dist-info/METADATA,sha256=prt8GgsAd9KBV3PqjpZuSeLNh8qCuNORd0iX-CNmjg8,4319
|
|
20
|
+
xaal_lib-0.7.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
+
xaal_lib-0.7.12.dist-info/top_level.txt,sha256=UZ2WDkN02ztkh1OrsjrW8Kmj4n3WqC0BQxaEYOYfWa0,5
|
|
22
|
+
xaal_lib-0.7.12.dist-info/RECORD,,
|
|
File without changes
|