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