base-aux 0.0.1__tar.gz

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 (145) hide show
  1. base_aux-0.0.1/LICENSE +22 -0
  2. base_aux-0.0.1/PKG-INFO +248 -0
  3. base_aux-0.0.1/README.md +227 -0
  4. base_aux-0.0.1/base_aux/_NEW/__init__.py +22 -0
  5. base_aux-0.0.1/base_aux/_NEW/main.py +53 -0
  6. base_aux-0.0.1/base_aux/__init__.py +0 -0
  7. base_aux-0.0.1/base_aux/alerts/__init__.py +20 -0
  8. base_aux-0.0.1/base_aux/alerts/_examples.py +103 -0
  9. base_aux-0.0.1/base_aux/alerts/base.py +266 -0
  10. base_aux-0.0.1/base_aux/alerts/smtp.py +76 -0
  11. base_aux-0.0.1/base_aux/alerts/telegram.py +45 -0
  12. base_aux-0.0.1/base_aux/bits/__init__.py +19 -0
  13. base_aux-0.0.1/base_aux/bits/bits.py +155 -0
  14. base_aux-0.0.1/base_aux/buses/__init__.py +81 -0
  15. base_aux-0.0.1/base_aux/buses/_examples.py +24 -0
  16. base_aux-0.0.1/base_aux/buses/_explore.py +45 -0
  17. base_aux-0.0.1/base_aux/buses/history.py +132 -0
  18. base_aux-0.0.1/base_aux/buses/i2c_client.py +98 -0
  19. base_aux-0.0.1/base_aux/buses/params_schema.py +149 -0
  20. base_aux-0.0.1/base_aux/buses/parser.py +72 -0
  21. base_aux-0.0.1/base_aux/buses/serial_client.py +1435 -0
  22. base_aux-0.0.1/base_aux/buses/serial_derivatives.py +58 -0
  23. base_aux-0.0.1/base_aux/buses/serial_server.py +505 -0
  24. base_aux-0.0.1/base_aux/classes/__init__.py +210 -0
  25. base_aux-0.0.1/base_aux/classes/annot_1_aux.py +150 -0
  26. base_aux-0.0.1/base_aux/classes/annot_2_all_defined.py +71 -0
  27. base_aux-0.0.1/base_aux/classes/annot_3_iter_values.py +44 -0
  28. base_aux-0.0.1/base_aux/classes/annot_4_cls_keys_as_values.py +125 -0
  29. base_aux-0.0.1/base_aux/classes/breeder_1_str_1_series.py +127 -0
  30. base_aux-0.0.1/base_aux/classes/breeder_1_str_2_stack.py +182 -0
  31. base_aux-0.0.1/base_aux/classes/breeder_2_objects.py +277 -0
  32. base_aux-0.0.1/base_aux/classes/cmp.py +71 -0
  33. base_aux-0.0.1/base_aux/classes/getattr_0_echo.py +62 -0
  34. base_aux-0.0.1/base_aux/classes/getattr_1_aux.py +37 -0
  35. base_aux-0.0.1/base_aux/classes/getattr_2_anycase.py +14 -0
  36. base_aux-0.0.1/base_aux/classes/getattr_3_prefix_1_inst.py +123 -0
  37. base_aux-0.0.1/base_aux/classes/getattr_3_prefix_2_cls.py +52 -0
  38. base_aux-0.0.1/base_aux/classes/middle_group.py +213 -0
  39. base_aux-0.0.1/base_aux/classes/number.py +280 -0
  40. base_aux-0.0.1/base_aux/classes/singleton.py +206 -0
  41. base_aux-0.0.1/base_aux/classes/singleton_examples.py +41 -0
  42. base_aux-0.0.1/base_aux/classes/static.py +12 -0
  43. base_aux-0.0.1/base_aux/classes/valid_0_aux.py +224 -0
  44. base_aux-0.0.1/base_aux/classes/valid_1_base.py +323 -0
  45. base_aux-0.0.1/base_aux/classes/valid_1_base_derivatives.py +65 -0
  46. base_aux-0.0.1/base_aux/classes/valid_2_chains.py +104 -0
  47. base_aux-0.0.1/base_aux/classes/valid_3_regexp.py +54 -0
  48. base_aux-0.0.1/base_aux/classes/value_1_variants.py +139 -0
  49. base_aux-0.0.1/base_aux/classes/value_2_unit.py +296 -0
  50. base_aux-0.0.1/base_aux/cli/__init__.py +35 -0
  51. base_aux-0.0.1/base_aux/cli/_examples.py +69 -0
  52. base_aux-0.0.1/base_aux/cli/main.py +315 -0
  53. base_aux-0.0.1/base_aux/funcs/__init__.py +98 -0
  54. base_aux-0.0.1/base_aux/funcs/args.py +85 -0
  55. base_aux-0.0.1/base_aux/funcs/arrays.py +64 -0
  56. base_aux-0.0.1/base_aux/funcs/ensure.py +81 -0
  57. base_aux-0.0.1/base_aux/funcs/iterables.py +147 -0
  58. base_aux-0.0.1/base_aux/funcs/pytest_aux.py +218 -0
  59. base_aux-0.0.1/base_aux/funcs/result_cum.py +168 -0
  60. base_aux-0.0.1/base_aux/funcs/static.py +55 -0
  61. base_aux-0.0.1/base_aux/funcs/strings.py +55 -0
  62. base_aux-0.0.1/base_aux/funcs/value_0_explicit.py +96 -0
  63. base_aux-0.0.1/base_aux/loggers/__init__.py +20 -0
  64. base_aux-0.0.1/base_aux/loggers/main.py +187 -0
  65. base_aux-0.0.1/base_aux/monitors/__init__.py +48 -0
  66. base_aux-0.0.1/base_aux/monitors/_examples.py +71 -0
  67. base_aux-0.0.1/base_aux/monitors/imap.py +205 -0
  68. base_aux-0.0.1/base_aux/monitors/url_tag.py +227 -0
  69. base_aux-0.0.1/base_aux/monitors/url_tag__derivatives.py +235 -0
  70. base_aux-0.0.1/base_aux/objects/__init__.py +114 -0
  71. base_aux-0.0.1/base_aux/objects/_examples.py +308 -0
  72. base_aux-0.0.1/base_aux/objects/info.py +379 -0
  73. base_aux-0.0.1/base_aux/objects/primitives.py +466 -0
  74. base_aux-0.0.1/base_aux/objects/types.py +254 -0
  75. base_aux-0.0.1/base_aux/privates/__init__.py +74 -0
  76. base_aux-0.0.1/base_aux/privates/_examples.py +125 -0
  77. base_aux-0.0.1/base_aux/privates/auto.py +38 -0
  78. base_aux-0.0.1/base_aux/privates/base.py +187 -0
  79. base_aux-0.0.1/base_aux/privates/csv.py +90 -0
  80. base_aux-0.0.1/base_aux/privates/derivatives.py +26 -0
  81. base_aux-0.0.1/base_aux/privates/env.py +48 -0
  82. base_aux-0.0.1/base_aux/privates/ini.py +43 -0
  83. base_aux-0.0.1/base_aux/privates/json.py +43 -0
  84. base_aux-0.0.1/base_aux/privates/static.py +22 -0
  85. base_aux-0.0.1/base_aux/pyqt/__init__.py +64 -0
  86. base_aux-0.0.1/base_aux/pyqt/_explore.py +12 -0
  87. base_aux-0.0.1/base_aux/pyqt/_from_t8.py +158 -0
  88. base_aux-0.0.1/base_aux/pyqt/base.py +36 -0
  89. base_aux-0.0.1/base_aux/pyqt/fonts.py +32 -0
  90. base_aux-0.0.1/base_aux/pyqt/gui.py +943 -0
  91. base_aux-0.0.1/base_aux/pyqt/hl.py +360 -0
  92. base_aux-0.0.1/base_aux/pyqt/signals.py +35 -0
  93. base_aux-0.0.1/base_aux/pyqt/th.py +84 -0
  94. base_aux-0.0.1/base_aux/pyqt/tm.py +330 -0
  95. base_aux-0.0.1/base_aux/requirements/__init__.py +75 -0
  96. base_aux-0.0.1/base_aux/requirements/_examples.py +16 -0
  97. base_aux-0.0.1/base_aux/requirements/pkgs.py +687 -0
  98. base_aux-0.0.1/base_aux/requirements/strings.py +291 -0
  99. base_aux-0.0.1/base_aux/requirements/versions.py +405 -0
  100. base_aux-0.0.1/base_aux/servers/__init__.py +80 -0
  101. base_aux-0.0.1/base_aux/servers/_examples.py +6 -0
  102. base_aux-0.0.1/base_aux/servers/client_requests.py +226 -0
  103. base_aux-0.0.1/base_aux/servers/server_aiohttp.py +261 -0
  104. base_aux-0.0.1/base_aux/servers/server_fastapi.py +645 -0
  105. base_aux-0.0.1/base_aux/servers/url.py +38 -0
  106. base_aux-0.0.1/base_aux/testplans/DEVICES/__init__.py +0 -0
  107. base_aux-0.0.1/base_aux/testplans/DEVICES/atc.py +47 -0
  108. base_aux-0.0.1/base_aux/testplans/DEVICES/dut.py +34 -0
  109. base_aux-0.0.1/base_aux/testplans/DEVICES/ptb.py +92 -0
  110. base_aux-0.0.1/base_aux/testplans/TESTCASES/__init__.py +3 -0
  111. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc01_exist1_ptb.py +21 -0
  112. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc01_exist2_psu.py +20 -0
  113. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc0_groups.py +17 -0
  114. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc0_test_tcinst_startup_fail.py +15 -0
  115. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc1_direct.py +22 -0
  116. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc2_reverse.py +31 -0
  117. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc3_atc.py +34 -0
  118. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc4_dut_ptb.py +41 -0
  119. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc5_group_1.py +16 -0
  120. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc5_group_2.py +15 -0
  121. base_aux-0.0.1/base_aux/testplans/TESTCASES/tc5_group_3.py +16 -0
  122. base_aux-0.0.1/base_aux/testplans/__init__.py +87 -0
  123. base_aux-0.0.1/base_aux/testplans/_explore.py +72 -0
  124. base_aux-0.0.1/base_aux/testplans/api.py +109 -0
  125. base_aux-0.0.1/base_aux/testplans/devices.py +118 -0
  126. base_aux-0.0.1/base_aux/testplans/gui.py +289 -0
  127. base_aux-0.0.1/base_aux/testplans/main.py +423 -0
  128. base_aux-0.0.1/base_aux/testplans/models.py +63 -0
  129. base_aux-0.0.1/base_aux/testplans/results.py +34 -0
  130. base_aux-0.0.1/base_aux/testplans/tc.py +539 -0
  131. base_aux-0.0.1/base_aux/testplans/tc_groups.py +69 -0
  132. base_aux-0.0.1/base_aux/testplans/tc_types.py +11 -0
  133. base_aux-0.0.1/base_aux/testplans/tm.py +277 -0
  134. base_aux-0.0.1/base_aux/threads/__init__.py +27 -0
  135. base_aux-0.0.1/base_aux/threads/_examples.py +32 -0
  136. base_aux-0.0.1/base_aux/threads/main.py +215 -0
  137. base_aux-0.0.1/base_aux.egg-info/PKG-INFO +248 -0
  138. base_aux-0.0.1/base_aux.egg-info/SOURCES.txt +144 -0
  139. base_aux-0.0.1/base_aux.egg-info/dependency_links.txt +1 -0
  140. base_aux-0.0.1/base_aux.egg-info/top_level.txt +1 -0
  141. base_aux-0.0.1/setup.cfg +4 -0
  142. base_aux-0.0.1/setup.py +62 -0
  143. base_aux-0.0.1/tests/test__alerts.py +63 -0
  144. base_aux-0.0.1/tests/test__monitors.py +53 -0
  145. base_aux-0.0.1/tests/test__threads.py +236 -0
base_aux-0.0.1/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2023 Andrei Starichenko
2
+
3
+ IMPORTANT: SEE ADDITIONAL DEPENDANT LICENSES FROM LIST OF USED PROJECTS FROM REQUIREMENTS.TXT!
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,248 @@
1
+ Metadata-Version: 2.1
2
+ Name: base_aux
3
+ Version: 0.0.1
4
+ Summary: collect all my previous moduls in one package
5
+ Home-page: https://github.com/centroid457/
6
+ Author: Andrei Starichenko
7
+ Author-email: centroid@mail.ru
8
+ Project-URL: Source, https://github.com/centroid457/base_aux
9
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Natural Language :: English
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.6
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+
22
+ ![Ver/TestedPython](https://img.shields.io/pypi/pyversions/base_aux)
23
+ ![Ver/Os](https://img.shields.io/badge/os_development-Windows-blue)
24
+ ![repo/Created](https://img.shields.io/github/created-at/centroid457/base_aux)
25
+ ![Commit/Last](https://img.shields.io/github/last-commit/centroid457/base_aux)
26
+ ![Tests/GitHubWorkflowStatus](https://github.com/centroid457/base_aux/actions/workflows/test_linux.yml/badge.svg)
27
+ ![Tests/GitHubWorkflowStatus](https://github.com/centroid457/base_aux/actions/workflows/test_windows.yml/badge.svg)
28
+ ![repo/Size](https://img.shields.io/github/repo-size/centroid457/base_aux)
29
+ ![Commit/Count/t](https://img.shields.io/github/commit-activity/t/centroid457/base_aux)
30
+ ![Commit/Count/y](https://img.shields.io/github/commit-activity/y/centroid457/base_aux)
31
+ ![Commit/Count/m](https://img.shields.io/github/commit-activity/m/centroid457/base_aux)
32
+
33
+ # base_aux (current v0.0.1/![Ver/Pypi Latest](https://img.shields.io/pypi/v/base_aux?label=pypi%20latest))
34
+
35
+ ## DESCRIPTION_SHORT
36
+ collect all my previous moduls in one package
37
+
38
+ ## DESCRIPTION_LONG
39
+ buses
40
+ --------------
41
+ NOTE: IT SEEMS THIS IS OLD DATA! see tests for actual usage!
42
+
43
+ !. MOST APPROPRIATE COMMAND PROTOCOL
44
+ other protocols mot recommended
45
+
46
+ 1. all cmds must be as params (preferred) in equipment or as special command
47
+ 2. [<CMD_NAME>] - read param value or run special command
48
+ [IDN] - read value IDN
49
+ [DUMP] - run special command
50
+ 3. [<CMD_NAME> <VALUE>] - write value in parameter or run special cmd with param
51
+ [VOUT 12.3] - set value into parameter VOUT
52
+ 4. [<CMD_NAME> ?] - get available values to write into parameter
53
+ [MODE ?] - return [0 1 2 3]
54
+ 5. all command sent must return answer
55
+ [OK] - if no value was asked
56
+ [<VALUE>] - if asked some value, returned without measurement unit
57
+ [FAIL] - any common not specified error
58
+ [FAIL 0123] - any specified error without description
59
+ [FAIL 02 VALUE OUT OF RANGE] - any specified error with description (full variant)
60
+
61
+
62
+
63
+ monitors
64
+ --------------
65
+ monitor exact data (urlTag/Email) and alert on changes by email/telegram (threading)
66
+ ## IMPORTANT!
67
+ NOT ALL WEBSITES WORKS! Sportmaster/Acra-rating/...
68
+
69
+ ## INSPIRATION
70
+ Suppose you wish to give blood to the Center.
71
+ So nowadays you need to make an appointment by website, BUT you can't do this while the Center actually don't need your group.
72
+ Group necessity shown on Center website and called DonorSvetofor.
73
+ And as result you need monitoring it manually, because there are no news, email notifications, subscriptions.
74
+ It's not difficult but if you do it as day routine (even once a day) its quite distracting.
75
+
76
+ So I created it first as Monitor_DonorSvetofor
77
+
78
+
79
+
80
+
81
+ TESTPLANS
82
+ --------------
83
+ designed to apply testplan for several DUTs
84
+
85
+ ## ПОНЯТИЯ
86
+ TC - TestCase
87
+ TP - TestPlan
88
+ DUT - Device Under Test - тестируемое устройство
89
+
90
+ ## АРХИТЕКТУРА
91
+ - тестплан
92
+ - работает в потоке,
93
+ - может быть остановлен в любой момент terminate(), при этом завершает все запущенные тесткейсы
94
+ - имеет настройки которые принимаются всеми тесткейсами за базовые и могут быть перезаписаны ими для себя
95
+ - имеет списки классов TC и обьектов DUT (генерирует обьекты TC для каждого DUT)
96
+ - для себя не разделяет обьекты тесткейсов, работает строго с классом тесткейса,
97
+ - выполняет все тесткейсы в порядке их следования на списке DUT
98
+ - в один момент времени выполняется только один класс тесткейса
99
+ - тесткейсы
100
+ - работают в потоке,
101
+ - может быть остановлен в любой момент terminate(), при этом завершаются безопасно (исполняются все teardown обьектов и глобальный классовый тесткейса),
102
+ - представляет собой класс инициируемый с входным параметром DUT,
103
+ - выполняются тесткейсы строго по очереди,
104
+ - каждый тесткейс выполняется на всех устройствах либо асинхронно, либо синхронно в зависимости от настройки,
105
+ - работа тесткейса полностью управляется классом тесткейса на серии устройств (возможно выполнение парных тестов с выбором нужных пар внутри тесткейса),
106
+ - результаты
107
+ - все результаты находятся в пока в обьекте тесткейса
108
+ - итогового (result)
109
+ - промежуточных результатов (details)
110
+ - настройки
111
+ - управление
112
+ - SKIP всех возможных вариантов (полностью тесткейс для всех устройств, полностью DUT для всех TC, отдельный TC на отдельном DUT),
113
+ - выполнение тесткейса синхронно/асинхронно
114
+ - данные для использования в тесткейсах
115
+ - реализовано в файлах JSON
116
+ - для каждого тесткейса и общие для тестплана (кейсовые накладываются на плановые)
117
+ - GUI тестплана
118
+ - запуск GUI опциональный,
119
+ - старт/стоп тестплана,
120
+ - отображение текущего тесткейса,
121
+ - отображение результата тескейса на каждом тестируемом устройстве,
122
+ - отображение промежуточных результатов (details)
123
+ - API
124
+ - минимальное API и запуск
125
+
126
+
127
+ ## Features
128
+ 1. cmp - apply for cmp object with others
129
+ 2. getattr prefix
130
+ 3. getattr echo
131
+ 4. middle group
132
+ 5. Number+NumberArithm - use class as number
133
+ 6. Annotations - work with annotations +use special abilities+use nested classes
134
+ 7. perfect singleton (maybe thread safe!)
135
+ 8. collect all instances
136
+ 9. check correct instantiating singletons in tree project
137
+ 10. check requirements (systemOs), raise/bool if no match
138
+ 11. create fuck(?)/source and is it for check for settings
139
+ 12. [python PACKAGES/MODULES]:
140
+ - upgrade
141
+ - delete
142
+ - version_get_installed
143
+ - check_installed)
144
+ - upgrade pip
145
+ 13. [VERSION]:
146
+ - parse
147
+ - check
148
+ - compare
149
+ 14. send commands into OS terminal
150
+ 15. check if cli commands are accessible (special utilities is installed)
151
+ 16. access to standard parts of result in a simple ready-to-use form (stdout/stderr/retcode/full state)
152
+ 17. use batch timeout for list
153
+ 18. till_first_true
154
+ 19. counter/counter_in_list
155
+ 20. designed for common work with bitfields-like objects
156
+ 21. Flags
157
+ 22. Bits
158
+ 23.
159
+ Designed to use private data like username/pwd kept secure in OsEnvironment or Ini/Json-File for your several home projects at ones.
160
+ And not open it in public.
161
+
162
+ **CAUTION:**
163
+ in requirements for other projects use fixed version! because it might be refactored so you would get exception soon.
164
+
165
+ 24. load values to instance attrs from:
166
+ - Environment
167
+ - IniFile
168
+ - JsonFile
169
+ - CsvFile
170
+ - direct text instead of file
171
+ - direct dict instead of file
172
+ 25. attr access:
173
+ - via any lettercase
174
+ - by instance attr
175
+ - like dict key on instance
176
+ 26. work with dict:
177
+ - apply
178
+ - update
179
+ - preupdate
180
+ 27. update_dict as cumulative result - useful in case of settings result
181
+ 28. use different managers for different funcs/methods if needed
182
+ 29. use just one decorator to spawn threads from func / methods
183
+ 30. keep all spawned threads in list by ThreadItem objects
184
+ 31. ThreadItem keeps result/exx/is_alive attributes!
185
+ 32. use wait_all/terminate_all()
186
+ 33. [SERVERS]:
187
+ - [aiohttp] (try not to use, as old)
188
+ - [FastApi] (preferred)
189
+ 34. client_requests item+stack
190
+ 35. [SerialClient]:
191
+ - keep all found ports in base class!
192
+ 36. Serial:
193
+ - Client+Server
194
+ - connect with Type__AddressAutoAcceptVariant FIRST_FREE/FIRST_FREE__ANSWER_VALID
195
+ - set/get params by SlashOrSpacePath addressing
196
+ - handle BackSpace send manually from terminal
197
+ 37. SerialServer values:
198
+ - as Callable
199
+ - ValueUnit
200
+ - ValueVariants
201
+ - list_results
202
+ 38. SerialServer cmd:
203
+ - NONE is equivalent for SUCCESS
204
+ - no need params (like line_parsed as before)
205
+ - help - for show all variants (Units/Variants/Callables)!
206
+ 39. Threading each monitor
207
+ 40. monitor:
208
+ - website data changes (tag text/attribute)
209
+ - email received with subject (by regexp) in exact folder
210
+ 41. Email/Telegram alert if:
211
+ - monitored data changed (from last state)
212
+ - html structure was changed so parsing can't be finished
213
+ - url became unreachable
214
+ 42. send alert msgs:
215
+ - emails
216
+ - telegram
217
+ 43. threading
218
+ 44. pyqt help examples and some other useful objects (overloaded pyqt classes)
219
+ 45. good template for TableView/Model/Signals
220
+ 46. add Events for TM/TV/PTE/...
221
+
222
+
223
+ ********************************************************************************
224
+ ## License
225
+ See the [LICENSE](LICENSE) file for license rights and limitations (MIT).
226
+
227
+
228
+ ## Release history
229
+ See the [HISTORY.md](HISTORY.md) file for release history.
230
+
231
+
232
+ ## Installation
233
+ ```commandline
234
+ pip install base-aux
235
+ ```
236
+
237
+
238
+ ## Import
239
+ ```python
240
+ from base_aux import *
241
+ ```
242
+
243
+
244
+ ********************************************************************************
245
+ ## USAGE EXAMPLES
246
+ See tests, sourcecode and docstrings for other examples.
247
+
248
+ ********************************************************************************
@@ -0,0 +1,227 @@
1
+ ![Ver/TestedPython](https://img.shields.io/pypi/pyversions/base_aux)
2
+ ![Ver/Os](https://img.shields.io/badge/os_development-Windows-blue)
3
+ ![repo/Created](https://img.shields.io/github/created-at/centroid457/base_aux)
4
+ ![Commit/Last](https://img.shields.io/github/last-commit/centroid457/base_aux)
5
+ ![Tests/GitHubWorkflowStatus](https://github.com/centroid457/base_aux/actions/workflows/test_linux.yml/badge.svg)
6
+ ![Tests/GitHubWorkflowStatus](https://github.com/centroid457/base_aux/actions/workflows/test_windows.yml/badge.svg)
7
+ ![repo/Size](https://img.shields.io/github/repo-size/centroid457/base_aux)
8
+ ![Commit/Count/t](https://img.shields.io/github/commit-activity/t/centroid457/base_aux)
9
+ ![Commit/Count/y](https://img.shields.io/github/commit-activity/y/centroid457/base_aux)
10
+ ![Commit/Count/m](https://img.shields.io/github/commit-activity/m/centroid457/base_aux)
11
+
12
+ # base_aux (current v0.0.1/![Ver/Pypi Latest](https://img.shields.io/pypi/v/base_aux?label=pypi%20latest))
13
+
14
+ ## DESCRIPTION_SHORT
15
+ collect all my previous moduls in one package
16
+
17
+ ## DESCRIPTION_LONG
18
+ buses
19
+ --------------
20
+ NOTE: IT SEEMS THIS IS OLD DATA! see tests for actual usage!
21
+
22
+ !. MOST APPROPRIATE COMMAND PROTOCOL
23
+ other protocols mot recommended
24
+
25
+ 1. all cmds must be as params (preferred) in equipment or as special command
26
+ 2. [<CMD_NAME>] - read param value or run special command
27
+ [IDN] - read value IDN
28
+ [DUMP] - run special command
29
+ 3. [<CMD_NAME> <VALUE>] - write value in parameter or run special cmd with param
30
+ [VOUT 12.3] - set value into parameter VOUT
31
+ 4. [<CMD_NAME> ?] - get available values to write into parameter
32
+ [MODE ?] - return [0 1 2 3]
33
+ 5. all command sent must return answer
34
+ [OK] - if no value was asked
35
+ [<VALUE>] - if asked some value, returned without measurement unit
36
+ [FAIL] - any common not specified error
37
+ [FAIL 0123] - any specified error without description
38
+ [FAIL 02 VALUE OUT OF RANGE] - any specified error with description (full variant)
39
+
40
+
41
+
42
+ monitors
43
+ --------------
44
+ monitor exact data (urlTag/Email) and alert on changes by email/telegram (threading)
45
+ ## IMPORTANT!
46
+ NOT ALL WEBSITES WORKS! Sportmaster/Acra-rating/...
47
+
48
+ ## INSPIRATION
49
+ Suppose you wish to give blood to the Center.
50
+ So nowadays you need to make an appointment by website, BUT you can't do this while the Center actually don't need your group.
51
+ Group necessity shown on Center website and called DonorSvetofor.
52
+ And as result you need monitoring it manually, because there are no news, email notifications, subscriptions.
53
+ It's not difficult but if you do it as day routine (even once a day) its quite distracting.
54
+
55
+ So I created it first as Monitor_DonorSvetofor
56
+
57
+
58
+
59
+
60
+ TESTPLANS
61
+ --------------
62
+ designed to apply testplan for several DUTs
63
+
64
+ ## ПОНЯТИЯ
65
+ TC - TestCase
66
+ TP - TestPlan
67
+ DUT - Device Under Test - тестируемое устройство
68
+
69
+ ## АРХИТЕКТУРА
70
+ - тестплан
71
+ - работает в потоке,
72
+ - может быть остановлен в любой момент terminate(), при этом завершает все запущенные тесткейсы
73
+ - имеет настройки которые принимаются всеми тесткейсами за базовые и могут быть перезаписаны ими для себя
74
+ - имеет списки классов TC и обьектов DUT (генерирует обьекты TC для каждого DUT)
75
+ - для себя не разделяет обьекты тесткейсов, работает строго с классом тесткейса,
76
+ - выполняет все тесткейсы в порядке их следования на списке DUT
77
+ - в один момент времени выполняется только один класс тесткейса
78
+ - тесткейсы
79
+ - работают в потоке,
80
+ - может быть остановлен в любой момент terminate(), при этом завершаются безопасно (исполняются все teardown обьектов и глобальный классовый тесткейса),
81
+ - представляет собой класс инициируемый с входным параметром DUT,
82
+ - выполняются тесткейсы строго по очереди,
83
+ - каждый тесткейс выполняется на всех устройствах либо асинхронно, либо синхронно в зависимости от настройки,
84
+ - работа тесткейса полностью управляется классом тесткейса на серии устройств (возможно выполнение парных тестов с выбором нужных пар внутри тесткейса),
85
+ - результаты
86
+ - все результаты находятся в пока в обьекте тесткейса
87
+ - итогового (result)
88
+ - промежуточных результатов (details)
89
+ - настройки
90
+ - управление
91
+ - SKIP всех возможных вариантов (полностью тесткейс для всех устройств, полностью DUT для всех TC, отдельный TC на отдельном DUT),
92
+ - выполнение тесткейса синхронно/асинхронно
93
+ - данные для использования в тесткейсах
94
+ - реализовано в файлах JSON
95
+ - для каждого тесткейса и общие для тестплана (кейсовые накладываются на плановые)
96
+ - GUI тестплана
97
+ - запуск GUI опциональный,
98
+ - старт/стоп тестплана,
99
+ - отображение текущего тесткейса,
100
+ - отображение результата тескейса на каждом тестируемом устройстве,
101
+ - отображение промежуточных результатов (details)
102
+ - API
103
+ - минимальное API и запуск
104
+
105
+
106
+ ## Features
107
+ 1. cmp - apply for cmp object with others
108
+ 2. getattr prefix
109
+ 3. getattr echo
110
+ 4. middle group
111
+ 5. Number+NumberArithm - use class as number
112
+ 6. Annotations - work with annotations +use special abilities+use nested classes
113
+ 7. perfect singleton (maybe thread safe!)
114
+ 8. collect all instances
115
+ 9. check correct instantiating singletons in tree project
116
+ 10. check requirements (systemOs), raise/bool if no match
117
+ 11. create fuck(?)/source and is it for check for settings
118
+ 12. [python PACKAGES/MODULES]:
119
+ - upgrade
120
+ - delete
121
+ - version_get_installed
122
+ - check_installed)
123
+ - upgrade pip
124
+ 13. [VERSION]:
125
+ - parse
126
+ - check
127
+ - compare
128
+ 14. send commands into OS terminal
129
+ 15. check if cli commands are accessible (special utilities is installed)
130
+ 16. access to standard parts of result in a simple ready-to-use form (stdout/stderr/retcode/full state)
131
+ 17. use batch timeout for list
132
+ 18. till_first_true
133
+ 19. counter/counter_in_list
134
+ 20. designed for common work with bitfields-like objects
135
+ 21. Flags
136
+ 22. Bits
137
+ 23.
138
+ Designed to use private data like username/pwd kept secure in OsEnvironment or Ini/Json-File for your several home projects at ones.
139
+ And not open it in public.
140
+
141
+ **CAUTION:**
142
+ in requirements for other projects use fixed version! because it might be refactored so you would get exception soon.
143
+
144
+ 24. load values to instance attrs from:
145
+ - Environment
146
+ - IniFile
147
+ - JsonFile
148
+ - CsvFile
149
+ - direct text instead of file
150
+ - direct dict instead of file
151
+ 25. attr access:
152
+ - via any lettercase
153
+ - by instance attr
154
+ - like dict key on instance
155
+ 26. work with dict:
156
+ - apply
157
+ - update
158
+ - preupdate
159
+ 27. update_dict as cumulative result - useful in case of settings result
160
+ 28. use different managers for different funcs/methods if needed
161
+ 29. use just one decorator to spawn threads from func / methods
162
+ 30. keep all spawned threads in list by ThreadItem objects
163
+ 31. ThreadItem keeps result/exx/is_alive attributes!
164
+ 32. use wait_all/terminate_all()
165
+ 33. [SERVERS]:
166
+ - [aiohttp] (try not to use, as old)
167
+ - [FastApi] (preferred)
168
+ 34. client_requests item+stack
169
+ 35. [SerialClient]:
170
+ - keep all found ports in base class!
171
+ 36. Serial:
172
+ - Client+Server
173
+ - connect with Type__AddressAutoAcceptVariant FIRST_FREE/FIRST_FREE__ANSWER_VALID
174
+ - set/get params by SlashOrSpacePath addressing
175
+ - handle BackSpace send manually from terminal
176
+ 37. SerialServer values:
177
+ - as Callable
178
+ - ValueUnit
179
+ - ValueVariants
180
+ - list_results
181
+ 38. SerialServer cmd:
182
+ - NONE is equivalent for SUCCESS
183
+ - no need params (like line_parsed as before)
184
+ - help - for show all variants (Units/Variants/Callables)!
185
+ 39. Threading each monitor
186
+ 40. monitor:
187
+ - website data changes (tag text/attribute)
188
+ - email received with subject (by regexp) in exact folder
189
+ 41. Email/Telegram alert if:
190
+ - monitored data changed (from last state)
191
+ - html structure was changed so parsing can't be finished
192
+ - url became unreachable
193
+ 42. send alert msgs:
194
+ - emails
195
+ - telegram
196
+ 43. threading
197
+ 44. pyqt help examples and some other useful objects (overloaded pyqt classes)
198
+ 45. good template for TableView/Model/Signals
199
+ 46. add Events for TM/TV/PTE/...
200
+
201
+
202
+ ********************************************************************************
203
+ ## License
204
+ See the [LICENSE](LICENSE) file for license rights and limitations (MIT).
205
+
206
+
207
+ ## Release history
208
+ See the [HISTORY.md](HISTORY.md) file for release history.
209
+
210
+
211
+ ## Installation
212
+ ```commandline
213
+ pip install base-aux
214
+ ```
215
+
216
+
217
+ ## Import
218
+ ```python
219
+ from base_aux import *
220
+ ```
221
+
222
+
223
+ ********************************************************************************
224
+ ## USAGE EXAMPLES
225
+ See tests, sourcecode and docstrings for other examples.
226
+
227
+ ********************************************************************************
@@ -0,0 +1,22 @@
1
+ # =====================================================================================================================
2
+ # VERSION = (0, 0, 1) # use import EXACT_OBJECTS! not *
3
+ # from .main import * # INcorrect
4
+ # from .main import EXACT_OBJECTS # CORRECT
5
+ # VERSION = (0, 0, 2) # del blank lines
6
+ # VERSION = (0, 0, 3) # separate all types/exx into static.py!
7
+
8
+
9
+ # =====================================================================================================================
10
+ # TEMPLATE
11
+ # from .static import (
12
+ # # TYPES
13
+ # # EXX
14
+ # )
15
+ # from .main import (
16
+ # # BASE
17
+ # # AUX
18
+ # )
19
+ # ---------------------------------------------------------------------------------------------------------------------
20
+
21
+
22
+ # =====================================================================================================================
@@ -0,0 +1,53 @@
1
+ import pathlib
2
+ from typing import *
3
+
4
+
5
+ # =====================================================================================================================
6
+ TYPE__PATH = Union[str, pathlib.Path]
7
+
8
+
9
+ # =====================================================================================================================
10
+ class NEW_CLASS____:
11
+ """
12
+ NOTE
13
+ ----
14
+
15
+ GOAL
16
+ ----
17
+
18
+ USEFUL IDEAS
19
+ ------------
20
+
21
+ CREATED SPECIALLY FOR
22
+ ---------------------
23
+ REPLACE:
24
+
25
+ CONSTRAINTS
26
+ -----------
27
+
28
+ BEST USAGE
29
+ ----------
30
+
31
+ SAME AS/OTHER VARIANTS
32
+ ----------------------
33
+ DIFFERENCE:
34
+
35
+ WHY NOT: 1?
36
+ ----------
37
+
38
+ WHY NOT: 2?
39
+ ----------
40
+
41
+ REFERENCE
42
+ ---------
43
+
44
+ """
45
+ def meth(self):
46
+ """
47
+ CREATED SPECIALLY FOR
48
+ ---------------------
49
+ """
50
+ pass
51
+
52
+
53
+ # =====================================================================================================================
File without changes
@@ -0,0 +1,20 @@
1
+ # =====================================================================================================================
2
+ # VERSION = (0, 0, 1) # use import EXACT_OBJECTS! not *
3
+ # from .main import * # INcorerct
4
+ # from .main import EXACT_OBJECTS # CORERCT
5
+
6
+
7
+ # =====================================================================================================================
8
+ from .base import AlertBase
9
+ from .smtp import SmtpAddress, SmtpServers, AlertSmtp
10
+ from .telegram import RecipientTgID, AlertTelegram
11
+
12
+
13
+ # =====================================================================================================================
14
+ # FIXME: move to main!
15
+ class AlertSelect:
16
+ SMTP_DEF = AlertSmtp
17
+ TELEGRAM_DEF = AlertTelegram
18
+
19
+
20
+ # =====================================================================================================================