ka-uts-com 2.1.0.250408__py3-none-any.whl → 2.2.0.250427__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.
- ka_uts_com/__version__.py +2 -2
- build/lib/ka_uts_com/base/app_.py → ka_uts_com/app.py +9 -11
- ka_uts_com/{base/cfg_.py → cfg.py} +7 -10
- ka_uts_com/com.py +47 -39
- build/lib/ka_uts_com/base/exit_.py → ka_uts_com/exit.py +1 -1
- ka_uts_com/timer.py +1 -1
- ka_uts_com-2.2.0.250427.dist-info/METADATA +929 -0
- ka_uts_com-2.2.0.250427.dist-info/RECORD +14 -0
- {ka_uts_com-2.1.0.250408.dist-info → ka_uts_com-2.2.0.250427.dist-info}/WHEEL +1 -1
- {ka_uts_com-2.1.0.250408.dist-info → ka_uts_com-2.2.0.250427.dist-info}/top_level.txt +0 -1
- build/lib/dist/ka_uts_com-2.0.0.250407-py3-none-any.whl +0 -0
- build/lib/dist/ka_uts_com-2.0.0.250407.tar.gz +0 -0
- build/lib/ka_uts_com/__init__.py +0 -0
- build/lib/ka_uts_com/__version__.py +0 -10
- build/lib/ka_uts_com/base/cfg_.py +0 -36
- build/lib/ka_uts_com/base/log_.py +0 -131
- build/lib/ka_uts_com/com.py +0 -115
- build/lib/ka_uts_com/data/__init__.py +0 -0
- build/lib/ka_uts_com/data/log.std.yml +0 -107
- build/lib/ka_uts_com/data/log.usr.yml +0 -106
- build/lib/ka_uts_com/decorators/dec.py +0 -13
- build/lib/ka_uts_com/fnc.py +0 -42
- build/lib/ka_uts_com/ioc/jinja2_.py +0 -42
- build/lib/ka_uts_com/ioc/yaml_.py +0 -31
- build/lib/ka_uts_com/log.py +0 -86
- build/lib/ka_uts_com/py.typed +0 -0
- build/lib/ka_uts_com/timer.py +0 -69
- build/lib/ka_uts_com/utils/aoeqstmt.py +0 -37
- build/lib/ka_uts_com/utils/date.py +0 -15
- build/lib/ka_uts_com/utils/doeq.py +0 -99
- build/lib/ka_uts_com/utils/pac.py +0 -35
- build/lib/ka_uts_com/utils/pacmod.py +0 -109
- build/lib/ka_uts_com/utils/str.py +0 -265
- dist/ka_uts_com-2.0.0.250407-py3-none-any.whl +0 -0
- dist/ka_uts_com-2.0.0.250407.tar.gz +0 -0
- ka_uts_com/base/app_.py +0 -50
- ka_uts_com/base/exit_.py +0 -37
- ka_uts_com/base/log_.py +0 -131
- ka_uts_com/data/__init__.py +0 -0
- ka_uts_com/data/log.std.yml +0 -107
- ka_uts_com/data/log.usr.yml +0 -106
- ka_uts_com/fnc.py +0 -42
- ka_uts_com/ioc/jinja2_.py +0 -42
- ka_uts_com/ioc/yaml_.py +0 -31
- ka_uts_com/log.py +0 -86
- ka_uts_com/utils/aoeqstmt.py +0 -37
- ka_uts_com/utils/date.py +0 -15
- ka_uts_com/utils/doeq.py +0 -99
- ka_uts_com/utils/pac.py +0 -35
- ka_uts_com/utils/pacmod.py +0 -109
- ka_uts_com/utils/str.py +0 -265
- ka_uts_com-2.1.0.250408.dist-info/METADATA +0 -1611
- ka_uts_com-2.1.0.250408.dist-info/RECORD +0 -55
- {ka_uts_com-2.1.0.250408.dist-info → ka_uts_com-2.2.0.250427.dist-info}/licenses/LICENSE.txt +0 -0
ka_uts_com/__version__.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
__title__ = 'ka_uts_com'
|
2
2
|
__description__ = 'Communication Utilities.'
|
3
3
|
__url__ = 'https://ka-ut-com.readthedocs.io/en/latest'
|
4
|
-
__version__ = '2.
|
4
|
+
__version__ = '2.2.0.250427'
|
5
5
|
__build__ = 0x022200
|
6
6
|
__author__ = 'Bernd Stroehle'
|
7
7
|
__author_email__ = 'bernd.stroehle@gmail.com'
|
8
8
|
__license__ = 'Apache-2.0'
|
9
|
-
__copyright__ = 'Copyright
|
9
|
+
__copyright__ = 'Copyright 2025 Bernd Stroehle'
|
10
10
|
__cake__ = u'\u2728 \U0001f370 \u2728'
|
@@ -1,16 +1,14 @@
|
|
1
1
|
# coding=utf-8
|
2
2
|
from typing import Any
|
3
3
|
|
4
|
-
from
|
5
|
-
|
6
|
-
from
|
7
|
-
from ka_uts_com.ioc.yaml_ import Yaml_
|
4
|
+
from ka_uts_log.log import Log
|
5
|
+
from ka_uts_uts.utils.pacmod import PacMod
|
6
|
+
from ka_uts_uts.ioc.yaml_ import Yaml_
|
8
7
|
|
9
8
|
TyAny = Any
|
10
9
|
TyArr = list[Any]
|
11
10
|
TyBool = bool
|
12
11
|
TyDic = dict[Any, Any]
|
13
|
-
TyLogger = Logger
|
14
12
|
|
15
13
|
TnAny = None | Any
|
16
14
|
TnArr = None | TyArr
|
@@ -18,7 +16,7 @@ TnBool = None | bool
|
|
18
16
|
TnDic = None | TyDic
|
19
17
|
|
20
18
|
|
21
|
-
class
|
19
|
+
class App:
|
22
20
|
"""Aplication Class
|
23
21
|
"""
|
24
22
|
sw_init: TyBool = False
|
@@ -29,7 +27,7 @@ class App_:
|
|
29
27
|
app: TyDic = {}
|
30
28
|
|
31
29
|
@classmethod
|
32
|
-
def init(cls,
|
30
|
+
def init(cls, cls_com, **kwargs) -> None:
|
33
31
|
if cls.sw_init:
|
34
32
|
return
|
35
33
|
cls.sw_init = True
|
@@ -37,14 +35,14 @@ class App_:
|
|
37
35
|
cls.sw_replace_keys = kwargs.get('sw_replace_keys', False)
|
38
36
|
if cls.sw_replace_keys:
|
39
37
|
try:
|
40
|
-
cls.keys = Yaml_.
|
38
|
+
cls.keys = Yaml_.read_with_safeloader(PacMod.sh_path_keys(cls_com))
|
41
39
|
except Exception as exc:
|
42
|
-
|
40
|
+
Log.error(exc, exc_info=True)
|
43
41
|
raise
|
44
42
|
|
45
43
|
@classmethod
|
46
|
-
def sh(cls,
|
44
|
+
def sh(cls, cls_com, **kwargs) -> Any:
|
47
45
|
if cls.sw_init:
|
48
46
|
return cls
|
49
|
-
cls.init(
|
47
|
+
cls.init(cls_com, **kwargs)
|
50
48
|
return cls
|
@@ -1,36 +1,33 @@
|
|
1
1
|
# coding=utf-8
|
2
2
|
from typing import Any
|
3
3
|
|
4
|
-
from
|
5
|
-
|
6
|
-
from ka_uts_com.ioc.yaml_ import Yaml_
|
4
|
+
from ka_uts_uts.ioc.yaml_ import Yaml_
|
7
5
|
|
8
6
|
TyAny = Any
|
9
7
|
TyTimeStamp = int
|
10
8
|
TyArr = list[Any]
|
11
9
|
TyBool = bool
|
12
10
|
TyDic = dict[Any, Any]
|
13
|
-
TyLogger = Logger
|
14
11
|
|
15
12
|
|
16
|
-
class
|
13
|
+
class Cfg:
|
17
14
|
"""Configuration Class
|
18
15
|
"""
|
19
16
|
sw_init: TyBool = False
|
20
17
|
cfg: Any = None
|
21
18
|
|
22
19
|
@classmethod
|
23
|
-
def init(cls,
|
20
|
+
def init(cls, cls_com, **kwargs) -> None:
|
24
21
|
if cls.sw_init:
|
25
22
|
return
|
26
23
|
cls.sw_init = True
|
27
|
-
_path =
|
24
|
+
_path = cls_com.sh_path_cfg_yaml()
|
28
25
|
if _path:
|
29
|
-
cls.cfg = Yaml_.
|
26
|
+
cls.cfg = Yaml_.read_with_safeloader(_path)
|
30
27
|
|
31
28
|
@classmethod
|
32
|
-
def sh(cls,
|
29
|
+
def sh(cls, cls_com, **kwargs) -> Any:
|
33
30
|
if cls.sw_init:
|
34
31
|
return cls
|
35
|
-
cls.init(
|
32
|
+
cls.init(cls_com, **kwargs)
|
36
33
|
return cls.cfg
|
ka_uts_com/com.py
CHANGED
@@ -4,18 +4,17 @@ from typing import Any
|
|
4
4
|
import os
|
5
5
|
import time
|
6
6
|
import calendar
|
7
|
-
import logging
|
8
|
-
import logging.config
|
9
|
-
from logging import Logger
|
10
7
|
from datetime import datetime
|
11
8
|
|
12
|
-
from
|
13
|
-
from
|
14
|
-
from
|
15
|
-
|
16
|
-
from ka_uts_com.
|
17
|
-
from ka_uts_com.
|
18
|
-
from ka_uts_com.
|
9
|
+
from ka_uts_equ.equ import AoEqu
|
10
|
+
from ka_uts_uts.utils.pac import Pac
|
11
|
+
from ka_uts_uts.utils.pacmod import PacMod
|
12
|
+
|
13
|
+
from ka_uts_com.app import App
|
14
|
+
from ka_uts_com.cfg import Cfg
|
15
|
+
from ka_uts_com.exit import Exit
|
16
|
+
|
17
|
+
from ka_uts_log.log import Log
|
19
18
|
|
20
19
|
TyAny = Any
|
21
20
|
TyDateTime = datetime
|
@@ -23,7 +22,6 @@ TyTimeStamp = int
|
|
23
22
|
TyArr = list[Any]
|
24
23
|
TyBool = bool
|
25
24
|
TyDic = dict[Any, Any]
|
26
|
-
TyLogger = Logger
|
27
25
|
|
28
26
|
TnAny = None | Any
|
29
27
|
TnArr = None | TyArr
|
@@ -34,7 +32,8 @@ TnStr = None | str
|
|
34
32
|
|
35
33
|
|
36
34
|
class Com:
|
37
|
-
"""
|
35
|
+
"""
|
36
|
+
Communication Class
|
38
37
|
"""
|
39
38
|
sw_init: bool = False
|
40
39
|
dir_dat: TnStr = None
|
@@ -54,14 +53,16 @@ class Com:
|
|
54
53
|
ts_etime: TnDateTime = None
|
55
54
|
d_timer: TyDic = {}
|
56
55
|
|
57
|
-
|
58
|
-
Log =
|
56
|
+
Cfg: TnDic = None
|
57
|
+
Log: Any = None
|
59
58
|
App: Any = None
|
60
59
|
Exit: Any = None
|
61
60
|
|
62
61
|
@classmethod
|
63
|
-
def init(cls,
|
64
|
-
|
62
|
+
def init(cls, kwargs: TyDic):
|
63
|
+
# def init(cls, cls_app, kwargs: TyDic):
|
64
|
+
"""
|
65
|
+
initialise static variables of Com class
|
65
66
|
"""
|
66
67
|
if cls.sw_init:
|
67
68
|
return
|
@@ -70,46 +71,53 @@ class Com:
|
|
70
71
|
cls.tenant = kwargs.get('tenant')
|
71
72
|
cls.log_type = kwargs.get('log_type', 'std')
|
72
73
|
cls.cmd = kwargs.get('cmd')
|
74
|
+
cls_app = kwargs.get('cls_app')
|
73
75
|
cls.d_com_pacmod = PacMod.sh_d_pacmod(cls)
|
74
|
-
cls.d_app_pacmod = PacMod.sh_d_pacmod(
|
76
|
+
cls.d_app_pacmod = PacMod.sh_d_pacmod(cls_app)
|
75
77
|
cls.ts = calendar.timegm(time.gmtime())
|
76
78
|
cls.pid = os.getpid()
|
77
79
|
|
78
80
|
cls.path_bin = cls.sh_path_bin()
|
79
|
-
cls.path_log_cfg = cls.sh_path_log_cfg()
|
80
81
|
|
81
|
-
cls.Log =
|
82
|
-
cls.
|
83
|
-
cls.App =
|
84
|
-
cls.Exit =
|
82
|
+
cls.Log = Log.sh(**kwargs)
|
83
|
+
cls.Cfg = Cfg.sh(cls, **kwargs)
|
84
|
+
cls.App = App.sh(cls, **kwargs)
|
85
|
+
cls.Exit = Exit.sh(**kwargs)
|
85
86
|
|
86
87
|
@classmethod
|
87
|
-
def sh_kwargs(cls,
|
88
|
-
|
89
|
-
|
88
|
+
def sh_kwargs(cls, cls_app, d_parms, *args) -> TyDic:
|
89
|
+
"""
|
90
|
+
show keyword arguments
|
91
|
+
"""
|
92
|
+
_kwargs: TyDic = AoEqu.sh_d_eq(*args, d_parms=d_parms)
|
93
|
+
_kwargs['cls_app'] = cls_app
|
94
|
+
cls.init(_kwargs)
|
90
95
|
_kwargs['com'] = cls
|
91
96
|
return _kwargs
|
92
97
|
|
93
98
|
@classmethod
|
94
99
|
def sh_path_bin(cls) -> Any:
|
95
|
-
""" show directory
|
96
100
|
"""
|
97
|
-
|
98
|
-
|
99
|
-
|
101
|
+
show path to bin directory in package
|
102
|
+
"""
|
103
|
+
_package = cls.d_app_pacmod['package']
|
104
|
+
_path = 'bin'
|
105
|
+
return Pac.sh_path_by_package(_package, _path)
|
100
106
|
|
101
107
|
@classmethod
|
102
|
-
def
|
103
|
-
""" show directory
|
108
|
+
def sh_path_data(cls) -> Any:
|
104
109
|
"""
|
105
|
-
|
106
|
-
|
107
|
-
|
110
|
+
show path to data directory in package
|
111
|
+
"""
|
112
|
+
_package = cls.d_app_pacmod['package']
|
113
|
+
_path = 'data'
|
114
|
+
return Pac.sh_path_by_package(_package, _path)
|
108
115
|
|
109
116
|
@classmethod
|
110
|
-
def
|
111
|
-
"""
|
117
|
+
def sh_path_cfg_yaml(cls) -> Any:
|
118
|
+
"""
|
119
|
+
show path to configuration yaml-file in data directory of package
|
112
120
|
"""
|
113
|
-
|
114
|
-
|
115
|
-
return Pac.sh_path_by_package(
|
121
|
+
_package = cls.d_app_pacmod['package']
|
122
|
+
_path = os.path.join('data', 'cfg.yml')
|
123
|
+
return Pac.sh_path_by_package(_package, _path)
|