ka-uts-com 4.0.2.250519__py3-none-any.whl → 4.0.4.250522__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 CHANGED
@@ -1,10 +1,10 @@
1
1
  __title__ = 'ka_uts_com'
2
2
  __description__ = 'Communication and CLI Utilities.'
3
3
  __url__ = 'https://ka-ut-com.readthedocs.io/en/latest'
4
- __version__ = '4.0.2.250519'
4
+ __version__ = '4.0.4.250522'
5
5
  __build__ = 0x022200
6
6
  __author__ = 'Bernd Stroehle'
7
7
  __author_email__ = 'bernd.stroehle@gmail.com'
8
- __license__ = 'Apache-2.0'
8
+ __license__ = 'GPL-3.0-only WITH Classpath-Exception-2.0 OR BSD-3-Clause'
9
9
  __copyright__ = 'Copyright 2025 Bernd Stroehle'
10
10
  __cake__ = u'\u2728 \U0001f370 \u2728'
ka_uts_com/com.py CHANGED
@@ -52,15 +52,13 @@ class Com:
52
52
  """
53
53
  if cls.sw_init:
54
54
  return
55
+ cls.sw_init = True
55
56
  cls.cmd = kwargs.get('cmd')
56
- _cls_app = kwargs.get('cls_app')
57
- # cls.d_com_pacmod = PacMod.sh_d_pacmod(cls)
58
- # cls.d_app_pacmod = PacMod.sh_d_pacmod(_cls_app)
59
57
  cls.com_a_mod = cls.__module__.split(".")
60
58
  cls.com_pac = cls.com_a_mod[0]
59
+ _cls_app = kwargs.get('cls_app')
61
60
  cls.app_a_mod = _cls_app.__module__.split(".")
62
61
  cls.app_pac = cls.app_a_mod[0]
63
- cls.sw_init = True
64
62
  cls.tenant = kwargs.get('tenant')
65
63
  cls.ts = calendar.timegm(time.gmtime())
66
64
 
ka_uts_com/dec.py CHANGED
@@ -1,6 +1,8 @@
1
1
  """
2
2
  Decorators Module
3
3
  """
4
+ import os
5
+ import sys
4
6
  import numpy as np
5
7
  from datetime import datetime
6
8
  from ka_uts_uts.utils.fnc import Fnc
@@ -11,7 +13,7 @@ def timer(fnc):
11
13
  """
12
14
  Timer Decorator
13
15
  """
14
- def wrapper(*args, **kwargs):
16
+ def __wrapper(*args, **kwargs):
15
17
  start = datetime.now()
16
18
  fnc(*args, **kwargs)
17
19
  _fnc_name = Fnc.sh_fnc_name(fnc)
@@ -20,4 +22,26 @@ def timer(fnc):
20
22
  np_elapse_time = np.format_float_positional(elapse_time, trim='k')
21
23
  msg = f"{_fnc_name} elapse time [sec] = {np_elapse_time}"
22
24
  Log.info(msg, stacklevel=2)
23
- return wrapper
25
+ return __wrapper
26
+
27
+
28
+ def handle_exception(exc_type, exc_value, exc_traceback):
29
+ if issubclass(exc_type, KeyboardInterrupt):
30
+ sys.__excepthook__(exc_type, exc_value, exc_traceback)
31
+ return
32
+ Log.critical(exc_value.message, exc_info=(exc_type, exc_value, exc_traceback))
33
+
34
+
35
+ def handle_error(fnc):
36
+ """
37
+ Error Decorator
38
+ """
39
+ def __wrapper(*args, **kwargs):
40
+ try:
41
+ fnc(*args, **kwargs)
42
+ os._exit(0)
43
+ except Exception:
44
+ exc_type, exc_value, exc_traceback = sys.exc_info()
45
+ handle_exception(exc_type, exc_value, exc_traceback)
46
+ os._exit(1)
47
+ return __wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ka_uts_com
3
- Version: 4.0.2.250519
3
+ Version: 4.0.4.250522
4
4
  Summary: Communication and CLI Utilities
5
5
  Author: Bernd Stroehle
6
6
  Author-email: bernd.stroehle@gmail.com
@@ -21,9 +21,9 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
21
  Requires-Python: >=3.10
22
22
  Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE.txt
24
- Requires-Dist: ka_uts_arr>=4.0.1.250513
25
- Requires-Dist: ka_uts_log>=4.0.1.250513
26
- Requires-Dist: ka_uts_uts>=4.0.2.250518
24
+ Requires-Dist: ka_uts_arr>=4.0.2.250519
25
+ Requires-Dist: ka_uts_log>=4.0.6.250522
26
+ Requires-Dist: ka_uts_uts>=4.0.3.250519
27
27
  Requires-Dist: numpy>=2.2.6
28
28
  Dynamic: license-file
29
29
 
@@ -0,0 +1,11 @@
1
+ ka_uts_com/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ ka_uts_com/__version__.py,sha256=dA4tv1GGQrBxxQUCbrAy6C-PZyqPqTs10nl7kenTYzA,420
3
+ ka_uts_com/com.py,sha256=zTyWPFuxopUEfrhwn9736hzln6NDas0J3YuCV6YA64c,1816
4
+ ka_uts_com/dec.py,sha256=JCKNNVPISJtXJfScX3rFcS9CjD0Ck2IUyK_53Gbov8Q,1276
5
+ ka_uts_com/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ ka_uts_com/timer.py,sha256=qVKanfNBnsU3B6C-Y5mjHWnS056GiYlRmFwEnX6BAU0,2546
7
+ ka_uts_com-4.0.4.250522.dist-info/licenses/LICENSE.txt,sha256=BiT3QGI_2iRbdvgS3HDig57lnXJVk60Pj4xM9eeCczI,814
8
+ ka_uts_com-4.0.4.250522.dist-info/METADATA,sha256=CnWw7YIGzK9Y54kq7pGCLhtTJzjNoteA53U_p07BXLo,32599
9
+ ka_uts_com-4.0.4.250522.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
10
+ ka_uts_com-4.0.4.250522.dist-info/top_level.txt,sha256=cWCIrm1g6Jn-FbCQuB3wBrrNH1YwqVlc6mE0jV6vg74,21
11
+ ka_uts_com-4.0.4.250522.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- ka_uts_com/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ka_uts_com/__version__.py,sha256=MnTyIshnEK9ysvQxq9S1sZHBeW0zVhmCMoy3sMtMSsM,373
3
- ka_uts_com/com.py,sha256=adNYxZIhPXLRLNyvJ772ZZRy70n2yKXPbrO5kFM3Bzk,1927
4
- ka_uts_com/dec.py,sha256=1qxjJI2Rem7ZyETP1z20SsYPSYQw0XHUAHa_JbachBE,615
5
- ka_uts_com/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- ka_uts_com/timer.py,sha256=qVKanfNBnsU3B6C-Y5mjHWnS056GiYlRmFwEnX6BAU0,2546
7
- ka_uts_com-4.0.2.250519.dist-info/licenses/LICENSE.txt,sha256=BiT3QGI_2iRbdvgS3HDig57lnXJVk60Pj4xM9eeCczI,814
8
- ka_uts_com-4.0.2.250519.dist-info/METADATA,sha256=nbt1ho98PUT5FQvo6JsfRQpOBggrA_TC6GWBRUV4P2M,32599
9
- ka_uts_com-4.0.2.250519.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
10
- ka_uts_com-4.0.2.250519.dist-info/top_level.txt,sha256=cWCIrm1g6Jn-FbCQuB3wBrrNH1YwqVlc6mE0jV6vg74,21
11
- ka_uts_com-4.0.2.250519.dist-info/RECORD,,