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.
Files changed (54) hide show
  1. ka_uts_com/__version__.py +2 -2
  2. build/lib/ka_uts_com/base/app_.py → ka_uts_com/app.py +9 -11
  3. ka_uts_com/{base/cfg_.py → cfg.py} +7 -10
  4. ka_uts_com/com.py +47 -39
  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.2.0.250427.dist-info/METADATA +929 -0
  8. ka_uts_com-2.2.0.250427.dist-info/RECORD +14 -0
  9. {ka_uts_com-2.1.0.250408.dist-info → ka_uts_com-2.2.0.250427.dist-info}/WHEEL +1 -1
  10. {ka_uts_com-2.1.0.250408.dist-info → ka_uts_com-2.2.0.250427.dist-info}/top_level.txt +0 -1
  11. build/lib/dist/ka_uts_com-2.0.0.250407-py3-none-any.whl +0 -0
  12. build/lib/dist/ka_uts_com-2.0.0.250407.tar.gz +0 -0
  13. build/lib/ka_uts_com/__init__.py +0 -0
  14. build/lib/ka_uts_com/__version__.py +0 -10
  15. build/lib/ka_uts_com/base/cfg_.py +0 -36
  16. build/lib/ka_uts_com/base/log_.py +0 -131
  17. build/lib/ka_uts_com/com.py +0 -115
  18. build/lib/ka_uts_com/data/__init__.py +0 -0
  19. build/lib/ka_uts_com/data/log.std.yml +0 -107
  20. build/lib/ka_uts_com/data/log.usr.yml +0 -106
  21. build/lib/ka_uts_com/decorators/dec.py +0 -13
  22. build/lib/ka_uts_com/fnc.py +0 -42
  23. build/lib/ka_uts_com/ioc/jinja2_.py +0 -42
  24. build/lib/ka_uts_com/ioc/yaml_.py +0 -31
  25. build/lib/ka_uts_com/log.py +0 -86
  26. build/lib/ka_uts_com/py.typed +0 -0
  27. build/lib/ka_uts_com/timer.py +0 -69
  28. build/lib/ka_uts_com/utils/aoeqstmt.py +0 -37
  29. build/lib/ka_uts_com/utils/date.py +0 -15
  30. build/lib/ka_uts_com/utils/doeq.py +0 -99
  31. build/lib/ka_uts_com/utils/pac.py +0 -35
  32. build/lib/ka_uts_com/utils/pacmod.py +0 -109
  33. build/lib/ka_uts_com/utils/str.py +0 -265
  34. dist/ka_uts_com-2.0.0.250407-py3-none-any.whl +0 -0
  35. dist/ka_uts_com-2.0.0.250407.tar.gz +0 -0
  36. ka_uts_com/base/app_.py +0 -50
  37. ka_uts_com/base/exit_.py +0 -37
  38. ka_uts_com/base/log_.py +0 -131
  39. ka_uts_com/data/__init__.py +0 -0
  40. ka_uts_com/data/log.std.yml +0 -107
  41. ka_uts_com/data/log.usr.yml +0 -106
  42. ka_uts_com/fnc.py +0 -42
  43. ka_uts_com/ioc/jinja2_.py +0 -42
  44. ka_uts_com/ioc/yaml_.py +0 -31
  45. ka_uts_com/log.py +0 -86
  46. ka_uts_com/utils/aoeqstmt.py +0 -37
  47. ka_uts_com/utils/date.py +0 -15
  48. ka_uts_com/utils/doeq.py +0 -99
  49. ka_uts_com/utils/pac.py +0 -35
  50. ka_uts_com/utils/pacmod.py +0 -109
  51. ka_uts_com/utils/str.py +0 -265
  52. ka_uts_com-2.1.0.250408.dist-info/METADATA +0 -1611
  53. ka_uts_com-2.1.0.250408.dist-info/RECORD +0 -55
  54. {ka_uts_com-2.1.0.250408.dist-info → ka_uts_com-2.2.0.250427.dist-info}/licenses/LICENSE.txt +0 -0
@@ -0,0 +1,929 @@
1
+ Metadata-Version: 2.4
2
+ Name: ka_uts_com
3
+ Version: 2.2.0.250427
4
+ Summary: Communication and CLIs Utilities
5
+ Author-email: Bernd Stroehle <bernd.stroehle@gmail.com>
6
+ Maintainer-email: Bernd Stroehle <bernd.stroehle@gmail.com>
7
+ License-Expression: GPL-3.0-only WITH Classpath-exception-2.0 OR BSD-3-Clause
8
+ Project-URL: Source Code, https://github.com/bs29/ka_uts_com/tree/master
9
+ Project-URL: Homepage, https://kosakya.de/
10
+ Project-URL: Documentation, https://ka-com.readthedocs.io/en/latest
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Natural Language :: English
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/x-rst
19
+ License-File: LICENSE.txt
20
+ Requires-Dist: ka_uts_equ>=2.2.0.250427
21
+ Requires-Dist: ka_uts_log>=2.1.1.250415
22
+ Requires-Dist: ka_uts_uts>=2.1.1.250415
23
+ Dynamic: license-file
24
+
25
+ ##########
26
+ ka_uts_com
27
+ ##########
28
+
29
+ Overview
30
+ ********
31
+
32
+ .. start short_desc
33
+
34
+ **Communication Utilities**
35
+
36
+ .. end short_desc
37
+
38
+ Installation
39
+ ************
40
+
41
+ .. start installation
42
+
43
+ The package ``ka_uts_com`` can be installed from PyPI or Anaconda.
44
+
45
+ To install with ``pip``:
46
+
47
+ .. code-block:: shell
48
+
49
+ $ python -m pip install ka_uts_com
50
+
51
+ To install with ``conda``:
52
+
53
+ .. code-block:: shell
54
+
55
+ $ conda install -c conda-forge ka_uts_com
56
+
57
+ .. end installation
58
+
59
+ Package files
60
+ *************
61
+
62
+ Classification
63
+ ==============
64
+
65
+ The Files of Package ``ka_uts_com`` could be classified into the follwing file types:
66
+
67
+ #. *Special files*
68
+ #. *Dunder modules*
69
+ #. *Decorator modules*
70
+ #. *Package modules*
71
+ #. *Data files*
72
+
73
+ Decorator Modules
74
+ *****************
75
+
76
+ Overview
77
+ ========
78
+
79
+ .. Decorator Modules-label:
80
+ .. table:: *Decorator Modules*
81
+
82
+ +------+-----------------+
83
+ |Name |Decription |
84
+ +======+=================+
85
+ |dec.py|Decorators module|
86
+ +------+-----------------+
87
+
88
+ Data Files
89
+ **********
90
+
91
+ Overview
92
+ ========
93
+
94
+ .. Data-Files-label:
95
+ .. table:: *Data Files*
96
+
97
+ +-----------+--------------------------------------------+
98
+ |Name |Description |
99
+ +===========+============================================+
100
+ |log.std.yml|Yaml configuration file for standard logging|
101
+ +-----------+--------------------------------------------+
102
+ |log.usr.yml|Yaml configuration file for user logging |
103
+ +-----------+--------------------------------------------+
104
+
105
+ Package Files
106
+ *************
107
+
108
+ Classification
109
+ ==============
110
+
111
+ The Modules of Package ``ka_uts_com`` could be classified into the following module types:
112
+
113
+ #. **Communication Modules**
114
+ #. **Base Modules**
115
+
116
+ Communication Modules
117
+ =====================
118
+
119
+ Overview
120
+ --------
121
+
122
+ .. Communication Modules-label:
123
+ .. table:: *Communication Modules*
124
+
125
+ +--------+-----------------------------+
126
+ |Name |Decription |
127
+ +========+=============================+
128
+ |com.py |Communication handling module|
129
+ +--------+-----------------------------+
130
+ |timer.py|Timer management module |
131
+ +--------+-----------------------------+
132
+
133
+ Communication module com.py
134
+ ===========================
135
+
136
+ The Communication Module ``com.py`` contains the single static class ``Com``.
137
+
138
+ Class Com
139
+ ---------
140
+
141
+ The static Class ``Com`` contains the subsequent variables and methods.
142
+
143
+ Variables
144
+ ^^^^^^^^^
145
+
146
+ .. Variables-of-class-Com-label:
147
+ .. table:: *Variables of class Com*
148
+
149
+ +--------+-----------+-------+-----------------------------------+
150
+ |Name |Type |Default|Description |
151
+ +========+===========+=======+===================================+
152
+ |d_pacmod|TyDic |{} |pacmod dictionary |
153
+ +--------+-----------+-------+-----------------------------------+
154
+ |pid |TyInt |None |current Process id |
155
+ +--------+-----------+-------+-----------------------------------+
156
+ |sw_init |TyBool |None |Initialisation switch |
157
+ +--------+-----------+-------+-----------------------------------+
158
+ |**Timestamp fields** |
159
+ +--------+-----------+-------+-----------------------------------+
160
+ |ts |TnTimeStamp|None |Timestamp |
161
+ +--------+-----------+-------+-----------------------------------+
162
+ |ts_start|TnDateTime |None |start timestamp in date time format|
163
+ +--------+-----------+-------+-----------------------------------+
164
+ |ts_end |TnDateTime |None |end timestamp in date time format |
165
+ +--------+-----------+-------+-----------------------------------+
166
+ |ts_etime|TnDateTime |None |elapse Time |
167
+ +--------+-----------+-------+-----------------------------------+
168
+ |d_timer |TyDic |False |Timer dictionary |
169
+ +--------+-----------+-------+-----------------------------------+
170
+ |**Links to other Classes** |
171
+ +--------+-----------+-------+-----------------------------------+
172
+ |App |TyAny |False |Application class |
173
+ +--------+-----------+-------+-----------------------------------+
174
+ |cfg |TyDic |None |Configuration dictionary |
175
+ +--------+-----------+-------+-----------------------------------+
176
+ |Log |TyLogger |False |Log class |
177
+ +--------+-----------+-------+-----------------------------------+
178
+ |Exit |TyAny |False |Exit class |
179
+ +--------+-----------+-------+-----------------------------------+
180
+
181
+ Methods
182
+ ^^^^^^^
183
+
184
+ .. Methods-of-class-Com-label:
185
+ .. table:: *Methods-of-class-Com*
186
+
187
+ +---------+-------------------------------------------------------+
188
+ |Name |Description |
189
+ +=========+=======================================================+
190
+ |init |Initialise static variables if they are not initialized|
191
+ +---------+-------------------------------------------------------+
192
+ |sh_kwargs|Show keyword arguments |
193
+ +---------+-------------------------------------------------------+
194
+
195
+ Method init
196
+ ^^^^^^^^^^^
197
+
198
+ Parameter
199
+ """""""""
200
+
201
+ .. Parameter-of-method-init-label:
202
+ .. table:: *Parameter-of-method-init*
203
+
204
+ +---------+-----+-----------------+
205
+ |Name |Type |Description |
206
+ +=========+=====+=================+
207
+ |cls |class|current class |
208
+ +---------+-----+-----------------+
209
+ |\**kwargs|TyAny|keyword arguments|
210
+ +---------+-----+-----------------+
211
+
212
+ Method sh_kwargs
213
+ ^^^^^^^^^^^^^^^^
214
+
215
+ Parameter
216
+ """""""""
217
+
218
+ .. Parameter-of-method-sh_kwargs-label:
219
+ .. table:: *Parameter of method sh_kwargs*
220
+
221
+ +--------+-----+--------------------+
222
+ |Name |Type |Description |
223
+ +========+=====+====================+
224
+ |cls |class|current class |
225
+ +--------+-----+--------------------+
226
+ |root_cls|class|root lass |
227
+ +--------+-----+--------------------+
228
+ |d_parms |TyDic|parameter dictionary|
229
+ +--------+-----+--------------------+
230
+ |\*args |list |arguments array |
231
+ +--------+-----+--------------------+
232
+
233
+ Time management Module timer.py
234
+ ===============================
235
+
236
+ Classes
237
+ -------
238
+
239
+ The Module ``timer.py`` contains the following classes
240
+
241
+
242
+ .. Static-classes-of-module-timer.py-label:
243
+ .. table:: *Static classes of module timer.py*
244
+
245
+ +---------+------+---------------+
246
+ |Name |Type |Description |
247
+ +=========+======+===============+
248
+ |Timestamp|static|Timestamp class|
249
+ +---------+------+---------------+
250
+ |Timer |static|Timer class |
251
+ +---------+------+---------------+
252
+
253
+
254
+ Class Timer
255
+ -----------
256
+
257
+ Methods
258
+ ^^^^^^^
259
+
260
+ .. Methods-of-class-Timer-label:
261
+ .. table:: *Methods of class Timer*
262
+
263
+ +----------+------------------------------------+
264
+ |Name |Description |
265
+ +==========+====================================+
266
+ |sh_task_id|Show task id |
267
+ +----------+------------------------------------+
268
+ |start |Start Timer |
269
+ +----------+------------------------------------+
270
+ |end |End Timer and Log Timer info message|
271
+ +----------+------------------------------------+
272
+
273
+ Method sh_task_id
274
+ ^^^^^^^^^^^^^^^^^
275
+
276
+ Show task id, which is created by the concatination of the following items if they are defined:
277
+ #. package,
278
+ #. module,
279
+ #. class_name,
280
+ #. parms
281
+ The items package and module are get from the package-module directory;
282
+ The item class_name is the class_id if its a string, otherwise the attribute
283
+ __qualname__ is used.
284
+
285
+ Parameter
286
+ """""""""
287
+
288
+ .. Parameter-of-method-sh_task_id-label:
289
+ .. table:: *Parameter-of-method-sh_task_id*
290
+
291
+ +--------+-----+-----------------+
292
+ |Name |Type |Description |
293
+ +========+=====+=================+
294
+ |d_pacmod|TyDic|pacmod dictionary|
295
+ +--------+-----+-----------------+
296
+ |class_id|TyAny|Class Id |
297
+ +--------+-----+-----------------+
298
+ |parms |TnAny|Parameters |
299
+ +--------+-----+-----------------+
300
+ |sep |TyStr|Separator |
301
+ +--------+-----+-----------------+
302
+
303
+ Return Value
304
+ """"""""""""
305
+
306
+ .. Return-value-of-method-sh_task_id-label:
307
+ .. table:: *Return value of method sh_task_id*
308
+
309
+ +----+-----+-----------+
310
+ |Name|Type |Description|
311
+ +====+=====+===========+
312
+ | |TyStr|Task Id |
313
+ +----+-----+-----------+
314
+
315
+ Method start
316
+ ^^^^^^^^^^^^
317
+
318
+ Parameter
319
+ """""""""
320
+
321
+ .. Parameter-of-method-start-label:
322
+ .. table:: *Parameter of method start*
323
+
324
+ +--------+-----+-------------+
325
+ |Name |Type |Description |
326
+ +========+=====+=============+
327
+ |cls |class|current class|
328
+ +--------+-----+-------------+
329
+ |class_id|TyAny|Class Id |
330
+ +--------+-----+-------------+
331
+ |parms |TnAny|Parameter |
332
+ +--------+-----+-------------+
333
+ |sep |TyStr|Separator |
334
+ +--------+-----+-------------+
335
+
336
+ Method: end
337
+ ^^^^^^^^^^^
338
+
339
+ Parameter
340
+ """""""""
341
+
342
+ .. Parameter-of-end-method-label:
343
+ .. table:: *Parameter of end method*
344
+
345
+ +--------+-----+-------------+
346
+ |Name |Type |Description |
347
+ +========+=====+=============+
348
+ |cls |class|current class|
349
+ +--------+-----+-------------+
350
+ |class_id|TyAny|Class Id |
351
+ +--------+-----+-------------+
352
+ |parms |TnAny|Parameter |
353
+ +--------+-----+-------------+
354
+ |sep |TyStr|Separator |
355
+ +--------+-----+-------------+
356
+
357
+ Base Modules
358
+ ************
359
+
360
+ Overview
361
+ ========
362
+
363
+ .. Base Modules-label:
364
+ .. table:: *Base Modules*
365
+
366
+ +---------+----------------------------+
367
+ |Name |Decription |
368
+ +=========+============================+
369
+ |app\_.py |Application setup module |
370
+ +---------+----------------------------+
371
+ |cfg\_.py |Configuration setup module |
372
+ +---------+----------------------------+
373
+ |exit\_.py|Exit Manafement setup module|
374
+ +---------+----------------------------+
375
+
376
+ Application setup module: app\_.py
377
+ ==================================
378
+
379
+ The Module ``app.py`` contains a single static class ``App_``.
380
+
381
+ Class: App\_
382
+ ------------
383
+
384
+ The static class ``App_`` contains the subsequent static variables and methods
385
+
386
+ Static Variables
387
+ ^^^^^^^^^^^^^^^^
388
+
389
+ .. Static-variables-of-class-App_-label:
390
+ .. table:: *Static Variables of class App_*
391
+
392
+ +---------------+-------+-------+---------------------+
393
+ |Name |Type |Default|Description |
394
+ +===============+=======+=======+=====================+
395
+ |sw_init |TyBool |False |initialisation switch|
396
+ +---------------+-------+-------+---------------------+
397
+ |httpmod |TyDic |None |http modus |
398
+ +---------------+-------+-------+---------------------+
399
+ |sw_replace_keys|TnBool |False |replace keys switch |
400
+ +---------------+-------+-------+---------------------+
401
+ |keys |TnArr |None |Keys array |
402
+ +---------------+-------+-------+---------------------+
403
+ |reqs |TyDic |None |Requests dictionary |
404
+ +---------------+-------+-------+---------------------+
405
+ |app |TyDic |None |Appliction dictionary|
406
+ +---------------+-------+-------+---------------------+
407
+
408
+ Methods
409
+ ^^^^^^^
410
+
411
+ .. Methods-of-class-App_-label:
412
+ .. table:: *Methods of class App_*
413
+
414
+ +----+------+------------------------------------+
415
+ |Name|Type |Description |
416
+ +====+======+====================================+
417
+ |init|class |initialise static variables of class|
418
+ | | |if they are not allready initialized|
419
+ +----+------+------------------------------------+
420
+ |sh |class |show (return) class |
421
+ +----+------+------------------------------------+
422
+
423
+ Method: init
424
+ ^^^^^^^^^^^^
425
+
426
+ Parameter
427
+ """""""""
428
+
429
+ .. Parameter-of-method-init-label:
430
+ .. table:: *Parameter of method init*
431
+
432
+ +---------+-----+-----------------+
433
+ |Name |Type |Description |
434
+ +=========+=====+=================+
435
+ |cls |class|Current class |
436
+ +---------+-----+-----------------+
437
+ |\**kwargs|TyAny|Keyword arguments|
438
+ +---------+-----+-----------------+
439
+
440
+ Method: sh
441
+ ^^^^^^^^^^
442
+
443
+ .. Parameter-of-method-sh-label:
444
+ .. table:: *Parameter of method sh*
445
+
446
+ +---------+-----+-----------------+
447
+ |Name |Type |Description |
448
+ +=========+=====+=================+
449
+ |cls |class|Current class |
450
+ +---------+-----+-----------------+
451
+ |\**kwargs|TyAny|Keyword arguments|
452
+ +---------+-----+-----------------+
453
+
454
+ Return Value
455
+ """"""""""""
456
+
457
+ .. Return-values-of-method-sh-label:
458
+ .. table:: *Return values of method sh*
459
+
460
+ +----+--------+-----------+
461
+ |Name|Type |Description|
462
+ +====+========+===========+
463
+ |log |TyLogger|Logger |
464
+ +----+--------+-----------+
465
+
466
+ cfg\_.py
467
+ ========
468
+
469
+ The Base module cfg\_.py contains a single static class ``Cfg_``.
470
+
471
+ Class Cfg\_
472
+ -----------
473
+
474
+ The static class ``Cfg_`` contains the subsequent static variables and methods
475
+
476
+ Static Variables
477
+ ^^^^^^^^^^^^^^^^
478
+
479
+ .. Static-variables-of-Cfg_-label:
480
+ .. table:: *Static Variables of Cfg_*
481
+
482
+ +----+-----+-------+--------------------+
483
+ |Name|Type |Default|Description |
484
+ +====+=====+=======+====================+
485
+ |cfg |TyDic|None |Configuration object|
486
+ +----+-----+-------+--------------------+
487
+
488
+ Methods
489
+ ^^^^^^^
490
+
491
+ .. Methods-of-class-Cfg_-label:
492
+ .. table:: *Methods of class Cfg_*
493
+
494
+ +----+------+-----------------------------------+
495
+ |Name|Type |Description |
496
+ +====+======+===================================+
497
+ |sh |class |read pacmod yaml file into class |
498
+ | | |variable cls.dic and return cls.cfg|
499
+ +----+------+-----------------------------------+
500
+
501
+ Method: sh
502
+ ^^^^^^^^^^
503
+
504
+ Parameter
505
+ """""""""
506
+
507
+ .. Parameter-of-method-init-label:
508
+ .. table:: *Parameter of method sh*
509
+
510
+ +--------+--------+-----------------+
511
+ |Name |Type |Description |
512
+ +========+========+=================+
513
+ |cls |class |Current class |
514
+ +--------+--------+-----------------+
515
+ |log |TyLogger|Logger |
516
+ +--------+--------+-----------------+
517
+ |d_pacmod|TyDic |pacmod dictionary|
518
+ +--------+--------+-----------------+
519
+
520
+ Return Value
521
+ """"""""""""
522
+
523
+ .. Return-values-of-method-sh-label:
524
+ .. table:: *Return values of method sh*
525
+
526
+ +-------+-----+-----------+
527
+ |Name |Type |Description|
528
+ +=======+=====+===========+
529
+ |cls.cfg|TyDic| |
530
+ +-------+-----+-----------+
531
+
532
+ Base Modul ext\_.py
533
+ ===================
534
+
535
+ The Base module exit\_.py contains a single static class ``Ext_``.
536
+
537
+ class Exit\_
538
+ ------------
539
+
540
+ The static Class ``Exit_`` contains the subsequent static variables and methods.
541
+
542
+ Static Variables
543
+ ^^^^^^^^^^^^^^^^
544
+
545
+ .. Static variables-of-class-Ext_-label:
546
+ .. table:: *Static variables of class Ext_*
547
+
548
+ +--------------+------+-------+---------------------+
549
+ |Name |Type |Default|Description |
550
+ +==============+======+=======+=====================+
551
+ |sw_init |TyBool|False |initialisation switch|
552
+ +--------------+------+-------+---------------------+
553
+ |sw_critical |TyBool|False |critical switch |
554
+ +--------------+------+-------+---------------------+
555
+ |sw_stop |TyBool|False |stop switch |
556
+ +--------------+------+-------+---------------------+
557
+ |sw_interactive|TyBool|False |interactive switch |
558
+ +--------------+------+-------+---------------------+
559
+
560
+ Methods
561
+ ^^^^^^^
562
+
563
+ .. Methods-of-class-Ext_-label:
564
+ .. table:: *Methods of class Ext_*
565
+
566
+ +----+------+------------------------------------+
567
+ |Name|Method|Description |
568
+ +====+======+====================================+
569
+ |init|class |initialise static variables of class|
570
+ | | |if they are not allready initialized|
571
+ +----+------+------------------------------------+
572
+ |sh |class |show (return) class |
573
+ +----+------+------------------------------------+
574
+
575
+ Method: init
576
+ ^^^^^^^^^^^^
577
+
578
+ Parameter
579
+ """""""""
580
+
581
+ .. Parameter-of-method-init-label:
582
+ .. table:: *Parameter of method init*
583
+
584
+ +---------+-----+-----------------+
585
+ |Name |Type |Description |
586
+ +=========+=====+=================+
587
+ |cls |class|Current class |
588
+ +---------+-----+-----------------+
589
+ |\**kwargs|TyAny|Keyword arguments|
590
+ +---------+-----+-----------------+
591
+
592
+ Method: sh
593
+ ^^^^^^^^^^
594
+
595
+ Parameter
596
+ """""""""
597
+
598
+ .. Parameter-of-method-sh-label:
599
+ .. table:: *Parameter of method sh*
600
+
601
+ +---------+-----+-----------------+
602
+ |Name |Type |Description |
603
+ +=========+=====+=================+
604
+ |cls |class|Current class |
605
+ +---------+-----+-----------------+
606
+ |\**kwargs|TyAny|Keyword arguments|
607
+ +---------+-----+-----------------+
608
+
609
+ Return Value
610
+ """"""""""""
611
+
612
+ .. Return-values-of-method-sh-label:
613
+ .. table:: *Return values of method sh*
614
+
615
+ +----+-----+-------------+
616
+ |Name|Type |Description |
617
+ +====+=====+=============+
618
+ |cls |class|Current class|
619
+ +----+-----+-------------+
620
+
621
+ Appendix
622
+ ********
623
+
624
+ Package Logging
625
+ ===============
626
+
627
+ Description
628
+ -----------
629
+
630
+ The Standard or user specifig logging is carried out by the log.py module of the logging
631
+ package ka_uts_log using the configuration files **ka_std_log.yml** or **ka_usr_log.yml**
632
+ in the configuration directory **cfg** of the logging package **ka_uts_log**.
633
+ The Logging configuration of the logging package could be overriden by yaml files with
634
+ the same names in the configuration directory **cfg** of the application packages.
635
+
636
+ Log message types
637
+ -----------------
638
+
639
+ Logging defines log file path names for the following log message types: .
640
+
641
+ #. *debug*
642
+ #. *info*
643
+ #. *warning*
644
+ #. *error*
645
+ #. *critical*
646
+
647
+ Application parameter for logging
648
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
649
+
650
+ .. Application-parameter-used-in-log-naming-label:
651
+ .. table:: *Application parameter used in log naming*
652
+
653
+ +-----------------+--------------------------+-----------------+------------+
654
+ |Name |Decription |Values |Example |
655
+ | | +-----------------+ |
656
+ | | |Value|Type | |
657
+ +=================+==========================+=====+===========+============+
658
+ |dir_dat |Application data directory| |Path |/otev/data |
659
+ +-----------------+--------------------------+-----+-----------+------------+
660
+ |tenant |Application tenant name | |str |UMH |
661
+ +-----------------+--------------------------+-----+-----------+------------+
662
+ |package |Application package name | |str |otev_xls_srr|
663
+ +-----------------+--------------------------+-----+-----------+------------+
664
+ |cmd |Application command | |str |evupreg |
665
+ +-----------------+--------------------------+-----+-----------+------------+
666
+ |pid |Process ID | |str |evupreg |
667
+ +-----------------+--------------------------+-----+-----------+------------+
668
+ |log_ts_type |Timestamp type used in |ts |Timestamp |ts |
669
+ | |loggin files +-----+-----------+------------+
670
+ | | |dt |Datetime | |
671
+ +-----------------+--------------------------+-----+-----------+------------+
672
+ |log_sw_single_dir|Enable single log |True |Bool |True |
673
+ | |directory or multiple +-----+-----------+ |
674
+ | |log directories |False|Bool | |
675
+ +-----------------+--------------------------+-----+-----------+------------+
676
+ |log_sw_pid |Enable display of pid |True |Bool |True |
677
+ | |in log file name +-----+-----------+ |
678
+ | | |False|Bool | |
679
+ +-----------------+--------------------------+-----+-----------+------------+
680
+
681
+ Log type and Log directories
682
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
683
+
684
+ Single or multiple Application log directories can be used for each message type:
685
+
686
+ .. Log-types-and-Log-directories-label:
687
+ .. table:: *Log types and directoriesg*
688
+
689
+ +--------------+---------------+
690
+ |Log type |Log directory |
691
+ +--------+-----+--------+------+
692
+ |long |short|multiple|single|
693
+ +========+=====+========+======+
694
+ |debug |dbqs |dbqs |logs |
695
+ +--------+-----+--------+------+
696
+ |info |infs |infs |logs |
697
+ +--------+-----+--------+------+
698
+ |warning |wrns |wrns |logs |
699
+ +--------+-----+--------+------+
700
+ |error |errs |errs |logs |
701
+ +--------+-----+--------+------+
702
+ |critical|crts |crts |logs |
703
+ +--------+-----+--------+------+
704
+
705
+ Log files naming
706
+ ^^^^^^^^^^^^^^^^
707
+
708
+ Conventions
709
+ """""""""""
710
+
711
+ .. Naming-conventions-for-logging-file-paths-label:
712
+ .. table:: *Naming conventions for logging file paths*
713
+
714
+ +--------+-------------------------------------------------------+-------------------------+
715
+ |Type |Directory |File |
716
+ +========+=======================================================+=========================+
717
+ |debug |/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
718
+ +--------+-------------------------------------------------------+-------------------------+
719
+ |info |/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
720
+ +--------+-------------------------------------------------------+-------------------------+
721
+ |warning |/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
722
+ +--------+-------------------------------------------------------+-------------------------+
723
+ |error |/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
724
+ +--------+-------------------------------------------------------+-------------------------+
725
+ |critical|/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
726
+ +--------+-------------------------------------------------------+-------------------------+
727
+
728
+ Examples (with log_ts_type = 'ts')
729
+ """"""""""""""""""""""""""""""""""
730
+
731
+ The examples use the following parameter values.
732
+
733
+ #. dir_dat = '/data/otev'
734
+ #. tenant = 'UMH'
735
+ #. package = 'otev_srr'
736
+ #. cmd = 'evupreg'
737
+ #. log_sw_single_dir = True
738
+ #. log_sw_pid = True
739
+ #. log_ts_type = 'ts'
740
+
741
+ .. Naming-examples-for-logging-file-paths-label:
742
+ .. table:: *Naming examples for logging file paths*
743
+
744
+ +--------+----------------------------------------+------------------------+
745
+ |Type |Directory |File |
746
+ +========+========================================+========================+
747
+ |debug |/data/otev/umh/RUN/otev_srr/evupreg/logs|debs_1737118199_9470.log|
748
+ +--------+----------------------------------------+------------------------+
749
+ |info |/data/otev/umh/RUN/otev_srr/evupreg/logs|infs_1737118199_9470.log|
750
+ +--------+----------------------------------------+------------------------+
751
+ |warning |/data/otev/umh/RUN/otev_srr/evupreg/logs|wrns_1737118199_9470.log|
752
+ +--------+----------------------------------------+------------------------+
753
+ |error |/data/otev/umh/RUN/otev_srr/evupreg/logs|errs_1737118199_9470.log|
754
+ +--------+----------------------------------------+------------------------+
755
+ |critical|/data/otev/umh/RUN/otev_srr/evupreg/logs|crts_1737118199_9470.log|
756
+ +--------+----------------------------------------+------------------------+
757
+
758
+ Python Terminology
759
+ ==================
760
+
761
+ Python package
762
+ --------------
763
+
764
+ Overview
765
+ ^^^^^^^^
766
+
767
+ .. Python package-label:
768
+ .. table:: *Python package*
769
+
770
+ +-----------+-----------------------------------------------------------------+
771
+ |Name |Definition |
772
+ +===========+==========+======================================================+
773
+ |Python |Python packages are directories that contains the special module |
774
+ |package |``__init__.py`` and other modules, packages files or directories.|
775
+ +-----------+-----------------------------------------------------------------+
776
+ |Python |Python sub-packages are python packages which are contained in |
777
+ |sub-package|another pyhon package. |
778
+ +-----------+-----------------------------------------------------------------+
779
+
780
+ Python package sub-directories
781
+ ------------------------------
782
+
783
+ Overview
784
+ ^^^^^^^^
785
+
786
+ .. Python package sub-direcories-label:
787
+ .. table:: *Python package sub-directories*
788
+
789
+ +---------------------+----------------------------------------+
790
+ |Name |Definition |
791
+ +=====================+========================================+
792
+ |Python |directory contained in a python package.|
793
+ |package sub-directory| |
794
+ +---------------------+----------------------------------------+
795
+ |Special python |Python package sub-directories with a |
796
+ |package sub-directory|special meaning like data or cfg. |
797
+ +---------------------+----------------------------------------+
798
+
799
+ Special python package sub-directories
800
+ --------------------------------------
801
+
802
+ Overview
803
+ ^^^^^^^^
804
+
805
+ .. Special-python-package-sub-directories-label:
806
+ .. table:: *Special python sun-directories*
807
+
808
+ +----+------------------------------------------+
809
+ |Name|Description |
810
+ +====+==========================================+
811
+ |data|Directory for package data files. |
812
+ +----+------------------------------------------+
813
+ |cfg |Directory for package configuration files.|
814
+ +----+------------------------------------------+
815
+
816
+ Python package files
817
+ --------------------
818
+
819
+ Overview
820
+ ^^^^^^^^
821
+
822
+ .. Python-package-files-label:
823
+ .. table:: *Python package files*
824
+
825
+ +--------------+---------------------------------------------------------+
826
+ |Name |Definition |
827
+ +==============+==========+==============================================+
828
+ |Python |File within a python package. |
829
+ |package file | |
830
+ +--------------+---------------------------------------------------------+
831
+ |Special python|Python package file which are not modules and used as |
832
+ |package file |python marker files like ``__init__.py``. |
833
+ +--------------+---------------------------------------------------------+
834
+ |Python |File with suffix ``.py`` which could be empty or contain |
835
+ |package module|python code; Other modules can be imported into a module.|
836
+ +--------------+---------------------------------------------------------+
837
+ |Special python|Python package module with special name and functionality|
838
+ |package module|like ``main.py`` or ``__init__.py``. |
839
+ +--------------+---------------------------------------------------------+
840
+
841
+ Special python package files
842
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
843
+
844
+ Overview
845
+ °°°°°°°°
846
+
847
+ .. Special-python-package-files-label:
848
+ .. table:: *Special python package files*
849
+
850
+ +--------+--------+---------------------------------------------------------------+
851
+ |Name |Type |Description |
852
+ +========+========+===============================================================+
853
+ |py.typed|Type |The ``py.typed`` file is a marker file used in Python packages |
854
+ | |checking|to indicate that the package supports type checking. This is a |
855
+ | |marker |part of the PEP 561 standard, which provides a standardized way|
856
+ | |file |to package and distribute type information in Python. |
857
+ +--------+--------+---------------------------------------------------------------+
858
+
859
+ Special python package modules
860
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
861
+
862
+ Overview
863
+ °°°°°°°°
864
+
865
+ .. Special-Python-package-modules-label:
866
+ .. table:: *Special Python package modules*
867
+
868
+ +--------------+-----------+-----------------------------------------------------------------+
869
+ |Name |Type |Description |
870
+ +==============+===========+=================================================================+
871
+ |__init__.py |Package |The dunder (double underscore) module ``__init__.py`` is used to |
872
+ | |directory |execute initialisation code or mark the directory it contains as |
873
+ | |marker |a package. The Module enforces explicit imports and thus clear |
874
+ | |file |namespace use and call them with the dot notation. |
875
+ +--------------+-----------+-----------------------------------------------------------------+
876
+ |__main__.py |entry point|The dunder module ``__main__.py`` serves as an entry point for |
877
+ | |for the |the package. The module is executed when the package is called by|
878
+ | |package |the interpreter with the command **python -m <package name>**. |
879
+ +--------------+-----------+-----------------------------------------------------------------+
880
+ |__version__.py|Version |The dunder module ``__version__.py`` consist of assignment |
881
+ | |file |statements used in Versioning. |
882
+ +--------------+-----------+-----------------------------------------------------------------+
883
+
884
+ Python elements
885
+ ---------------
886
+
887
+ Overview
888
+ °°°°°°°°
889
+
890
+ .. Python elements-label:
891
+ .. table:: *Python elements*
892
+
893
+ +-------------------+---------------------------------------------+
894
+ |Name |Definition |
895
+ +===================+=============================================+
896
+ |Python method |Function defined in a python module. |
897
+ +-------------------+---------------------------------------------+
898
+ |Special |Python method with special name and |
899
+ |python method |functionality like ``init``. |
900
+ +-------------------+---------------------------------------------+
901
+ |Python class |Python classes are defined in python modules.|
902
+ +-------------------+---------------------------------------------+
903
+ |Python class method|Python method defined in a python class. |
904
+ +-------------------+---------------------------------------------+
905
+ |Special |Python class method with special name and |
906
+ |Python class method|functionality like ``init``. |
907
+ +-------------------+---------------------------------------------+
908
+
909
+ Special python methods
910
+ ^^^^^^^^^^^^^^^^^^^^^^
911
+
912
+ Overview
913
+ °°°°°°°°
914
+
915
+ .. Special-python-methods-label:
916
+ .. table:: *Special python methods*
917
+
918
+ +--------+------------+----------------------------------------------------------+
919
+ |Name |Type |Description |
920
+ +========+============+==========================================================+
921
+ |__init__|class object|The special method ``__init__`` is called when an instance|
922
+ | |constructor |(object) of a class is created; instance attributes can be|
923
+ | |method |defined and initalized in the method. |
924
+ +--------+------------+----------------------------------------------------------+
925
+
926
+ Table of Contents
927
+ =================
928
+
929
+ .. contents:: **Table of Content**