lyrpy 0.0.2__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.
lyr/LUParserREG.py ADDED
@@ -0,0 +1,510 @@
1
+ """LUParserREG.py"""
2
+ # -*- coding: UTF-8 -*-
3
+ __annotations__ = """
4
+ =======================================================
5
+ Copyright (c) 2023
6
+ Author:
7
+ Lisitsin Y.R.
8
+ Project:
9
+ LU_PY
10
+ Python (LU)
11
+ Module:
12
+ LUParserREG.py
13
+
14
+ =======================================================
15
+ """
16
+
17
+ #------------------------------------------
18
+ # БИБЛИОТЕКИ python
19
+ #------------------------------------------
20
+ import winreg
21
+ import enum
22
+
23
+ #------------------------------------------
24
+ # БИБЛИОТЕКИ сторонние
25
+ #------------------------------------------
26
+
27
+ #------------------------------------------
28
+ # БИБЛИОТЕКА LU
29
+ #------------------------------------------
30
+
31
+ #----------------------------------------------------------
32
+ # HKEY_* Constants
33
+ #----------------------------------------------------------
34
+ """
35
+ winreg.HKEY_CLASSES_ROOT
36
+ Registry entries subordinate to this key define types (or classes) of documents and the properties associated with those types. Shell and COM applications use the information stored under this key.
37
+ ---------------------
38
+ winreg.HKEY_CURRENT_USER
39
+ Registry entries subordinate to this key define the preferences of the current user. These preferences include the settings of environment variables, data about program groups, colors, printers, network connections, and application preferences.
40
+ ---------------------
41
+ winreg.HKEY_LOCAL_MACHINE
42
+ Registry entries subordinate to this key define the physical state of the computer, including data about the bus type, system memory, and installed hardware and software.
43
+ ---------------------
44
+ winreg.HKEY_USERS
45
+ Registry entries subordinate to this key define the default user configuration for new users on the local computer and the user configuration for the current user.
46
+ ---------------------
47
+ winreg.HKEY_PERFORMANCE_DATA
48
+ Registry entries subordinate to this key allow you to access performance data. The data is not actually stored in the registry; the registry functions cause the system to collect the data from its source.
49
+ ---------------------
50
+ winreg.HKEY_CURRENT_CONFIG
51
+ Contains information about the current hardware profile of the local computer system.
52
+ ---------------------
53
+ winreg.HKEY_DYN_DATA
54
+ This key is not used in versions of Windows after 98.
55
+ ---------------------
56
+ """
57
+ @enum.unique
58
+ class THKEYConst(enum.Enum):
59
+ """THKEYConst"""
60
+ cHKCR = winreg.HKEY_CLASSES_ROOT
61
+ cHKCU = winreg.HKEY_CURRENT_USER
62
+ cHKLM = winreg.HKEY_LOCAL_MACHINE
63
+ cHKU = winreg.HKEY_USERS
64
+ cHKPD = winreg.HKEY_PERFORMANCE_DATA
65
+ cHKCC = winreg.HKEY_CURRENT_CONFIG
66
+ cHKDD = winreg.HKEY_DYN_DATA
67
+ #endclass
68
+
69
+ #---------------------------------------------------------
70
+ # Access Rights
71
+ #---------------------------------------------------------
72
+ """
73
+ winreg.KEY_ALL_ACCESS
74
+ Combines the STANDARD_RIGHTS_REQUIRED, KEY_QUERY_VALUE, KEY_SET_VALUE, KEY_CREATE_SUB_KEY, KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, and KEY_CREATE_LINK access rights.
75
+ ---------------------
76
+ winreg.KEY_WRITE
77
+ Combines the STANDARD_RIGHTS_WRITE, KEY_SET_VALUE, and KEY_CREATE_SUB_KEY access rights.
78
+ ---------------------
79
+ winreg.KEY_READ
80
+ Combines the STANDARD_RIGHTS_READ, KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY values.
81
+ ---------------------
82
+ winreg.KEY_EXECUTE
83
+ Equivalent to KEY_READ.
84
+ ---------------------
85
+ winreg.KEY_QUERY_VALUE
86
+ Required to query the values of a registry key.
87
+ ---------------------
88
+ winreg.KEY_SET_VALUE
89
+ Required to create, delete, or set a registry value.
90
+ ---------------------
91
+ winreg.KEY_CREATE_SUB_KEY
92
+ Required to create a subkey of a registry key.
93
+ ---------------------
94
+ winreg.KEY_ENUMERATE_SUB_KEYS
95
+ Required to enumerate the subkeys of a registry key.
96
+ ---------------------
97
+ winreg.KEY_NOTIFY
98
+ Required to request change notifications for a registry key or for subkeys of a registry key.
99
+ ---------------------
100
+ winreg.KEY_CREATE_LINK
101
+ Reserved for system use.
102
+ ---------------------
103
+ """
104
+ # @enum.unique
105
+ class TKEYAccess(enum.Enum):
106
+ """TKEYAccess"""
107
+ kaALL_ACCESS = winreg.KEY_ALL_ACCESS
108
+ kaWRITE = winreg.KEY_WRITE
109
+ kaREAD = winreg.KEY_READ
110
+ kaEXECUTE = winreg.KEY_EXECUTE
111
+ kaQUERY_VALUE = winreg.KEY_QUERY_VALUE
112
+ kaSET_VALUE = winreg.KEY_SET_VALUE
113
+ kaCREATE_SUB_KEY = winreg.KEY_CREATE_SUB_KEY
114
+ kaENUMERATE_SUB_KEYS = winreg.KEY_ENUMERATE_SUB_KEYS
115
+ kaKEY_NOTIFY = winreg.KEY_NOTIFY
116
+ kaKEY_CREATE_LINK = winreg.KEY_CREATE_LINK
117
+ #endclass
118
+
119
+ #---------------------------------------------------------
120
+ # Value Types¶
121
+ # ---------------------------------------------------------
122
+ """
123
+ winreg.REG_BINARY
124
+ Binary data in any form.
125
+ ---------------------
126
+ winreg.REG_DWORD
127
+ 32-bit number.
128
+ ---------------------
129
+ winreg.REG_DWORD_LITTLE_ENDIAN
130
+ A 32-bit number in little-endian format. Equivalent to REG_DWORD.
131
+ ---------------------
132
+ winreg.REG_DWORD_BIG_ENDIAN
133
+ A 32-bit number in big-endian format.
134
+ ---------------------
135
+ winreg.REG_EXPAND_SZ
136
+ Null-terminated string containing references to environment variables (%PATH%).
137
+ ---------------------
138
+ winreg.REG_LINK
139
+ A Unicode symbolic link.
140
+ ---------------------
141
+ winreg.REG_MULTI_SZ
142
+ A sequence of null-terminated strings, terminated by two null characters. (Python handles this termination automatically.)
143
+ ---------------------
144
+ winreg.REG_NONE
145
+ No defined value type.
146
+ ---------------------
147
+ """
148
+ # @enum.unique
149
+ class TValueTypes(enum.Enum):
150
+ """TValueTypes"""
151
+ vtBINARY = winreg.REG_BINARY
152
+ vtDWORD = winreg.REG_DWORD
153
+ vtDWORD_LITTLE_ENDIAN = winreg.REG_DWORD_LITTLE_ENDIAN
154
+ vtDWORD_BIG_ENDIAN = winreg.REG_DWORD_BIG_ENDIAN
155
+ vtEXPAND_SZ = winreg.REG_EXPAND_SZ
156
+ vtLINK = winreg.REG_LINK
157
+ vtMULTI_SZ = winreg.REG_MULTI_SZ
158
+ vtNONE = winreg.REG_NONE
159
+ #endclass
160
+
161
+ #-------------------------------------------------------------------------------
162
+ # General Reestr Keys
163
+ #-------------------------------------------------------------------------------
164
+ RootKeyHKLM = winreg.HKEY_LOCAL_MACHINE
165
+ RootKeyHKCU = winreg.HKEY_CURRENT_USER
166
+
167
+ cHKLMSCCS = r'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet'
168
+ cHKLMSMWCV = r'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion'
169
+ cHKLMSMWNTCV = r'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion'
170
+ cHKCUSMWCV = r'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion'
171
+ cHKCUSMWNTCV = r'HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion'
172
+
173
+ class TREGParser (object):
174
+ """TREGParser"""
175
+ luClassName = 'TREGParser'
176
+ __annotations__ =\
177
+ """
178
+ TREGParser - Работа с реестром windows
179
+
180
+ aReg = _winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE)
181
+
182
+ """
183
+ #--------------------------------------------------
184
+ # constructor
185
+ #--------------------------------------------------
186
+ def __init__ (self, **kwargs):
187
+ """ Constructor """
188
+ #beginfunction
189
+ super ().__init__ (**kwargs)
190
+ self.__Fhkey = 0
191
+ ...
192
+ #endfunction
193
+
194
+ #--------------------------------------------------
195
+ # destructor
196
+ #--------------------------------------------------
197
+ def __del__ (self):
198
+ """ destructor """
199
+ #beginfunction
200
+ LClassName = self.__class__.__name__
201
+ s = '{} уничтожен'.format (LClassName)
202
+ # LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
203
+ #print (s)
204
+ #endfunction
205
+
206
+ #--------------------------------------------------
207
+ # @property hkey
208
+ #--------------------------------------------------
209
+ # getter
210
+ @property
211
+ def hkey(self):
212
+ #beginfunction
213
+ return self.__Fhkey
214
+ #endfunction
215
+ # setter
216
+ @hkey.setter
217
+ def hkey (self, AValue: int):
218
+ #beginfunction
219
+ self.__Fhkey = AValue
220
+ #endfunction
221
+
222
+ def CreateKeyReg (self, AHKEY: THKEYConst, ASection: str) -> bool:
223
+ """CreateKeyReg"""
224
+ #beginfunction
225
+ # winreg.CreateKey (key, sub_key)
226
+ # Создает или открывает указанный ключ, возвращая объект дескриптора
227
+ # winreg.CreateKeyEx(key, sub_key, reserved=0, access=KEY_WRITE)
228
+ # Создает или открывает указанный ключ, возвращая объект дескриптора
229
+ self.hkey = None
230
+ try:
231
+ self.hkey = winreg.CreateKeyEx (AHKEY.value, ASection, 0, TKEYAccess.kaALL_ACCESS.value)
232
+ self.CloseKeyReg (self.hkey)
233
+ except FileNotFoundError as ERROR:
234
+ ...
235
+ finally:
236
+ return not self.hkey is None
237
+ #endfunction
238
+
239
+ @staticmethod
240
+ def DeleteKeyReg (AHKEY: THKEYConst, ASection: str):
241
+ """DeleteKeyReg"""
242
+ #beginfunction
243
+ # winreg.DeleteKey (key, sub_key)
244
+ # Удаляет указанный ключ.
245
+ # winreg.DeleteKeyEx (key, sub_key, access = KEY_WOW64_64KEY, reserved = 0)
246
+ # Удаляет указанный ключ.
247
+ LResult = False
248
+ try:
249
+ winreg.DeleteKey (AHKEY.value, ASection)
250
+ LResult = True
251
+ except FileNotFoundError as ERROR:
252
+ ...
253
+ finally:
254
+ return LResult
255
+ #endfunction
256
+
257
+ def OpenKeyReg (self, AHKEY: THKEYConst, ASection: str):
258
+ """OpenKeyReg"""
259
+ #beginfunction
260
+ #+winreg.OpenKey (key, sub_key, reserved = 0, access = KEY_READ)
261
+ # Открывает указанный ключ, возвращая объект дескриптора .
262
+ #+winreg.OpenKeyEx (key, sub_key, reserved = 0, access = KEY_READ)
263
+ # Открывает указанный ключ, возвращая объект дескриптора .
264
+ self.hkey = None
265
+ try:
266
+ self.hkey = winreg.OpenKeyEx (AHKEY.value, ASection, 0, TKEYAccess.kaALL_ACCESS.value)
267
+ except FileNotFoundError as ERROR:
268
+ ...
269
+ finally:
270
+ return self.hkey
271
+ #endfunction
272
+
273
+ @staticmethod
274
+ def CloseKeyReg (Ahkey):
275
+ """CloseKeyReg"""
276
+ #beginfunction
277
+ # winreg.CloseKey(hkey)
278
+ # Закрывает ранее открытый раздел реестра. HKEY аргумент указывает, ранее открытый ключ.
279
+ # Если hkey не закрыт с помощью этого метода (или через hkey.Close() ), он закрывается,
280
+ # когда объект hkey уничтожается Python.
281
+ LResult = False
282
+ if Ahkey:
283
+ winreg.CloseKey (Ahkey)
284
+ LResult = True
285
+ return LResult
286
+ #endfunction
287
+
288
+ def EnumKeyReg (self, AHKEY: THKEYConst, ASection: str) -> []:
289
+ """EnumKeyReg"""
290
+ #beginfunction
291
+ # winreg.EnumKey (key, index)
292
+ # Нумеровывает подклавиши открытого ключа реестра,возвращая строку.
293
+ LInfo = self.QueryInfoKeyReg (AHKEY, ASection)
294
+ LList = []
295
+ if len(LInfo) > 0:
296
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
297
+ # LWork = EnumKey (self.hkey, 0)
298
+ for i in range (LInfo[0],LInfo[1]):
299
+ try:
300
+ LWork = winreg.EnumKey (self.hkey, i)
301
+ except OSError as ERROR:
302
+ LWork = ERROR.strerror
303
+ #LUErrors.LUFileError_FileNotExist as ERROR
304
+ ...
305
+ finally:
306
+ ...
307
+ LList.append(LWork)
308
+ self.CloseKeyReg (self.hkey)
309
+ return LList
310
+ #endfunction
311
+
312
+ def EnumValueReg (self, AHKEY: THKEYConst, ASection: str) -> []:
313
+ """EnumValueReg"""
314
+ #beginfunction
315
+ #+winreg.EnumValue (key, index)
316
+ # Перечисляет значения открытого ключа реестра,возвращая кортеж.
317
+ LInfo = self.QueryInfoKeyReg (AHKEY, ASection)
318
+ LList = []
319
+ if len(LInfo) > 0:
320
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
321
+ for i in range (LInfo[0],LInfo[1]):
322
+ LList.append(winreg.EnumValue (self.hkey, i))
323
+ # LKeyName, LValue, LFormat = EnumValue (self.hkey, i)
324
+ self.CloseKeyReg (self.hkey)
325
+ return LList
326
+ #endfunction
327
+
328
+ def SaveKeyReg (self, AHKEY: THKEYConst, ASection: str, AFileName: str):
329
+ """SaveKeyReg"""
330
+ #beginfunction
331
+ # winreg.SaveKey (key, file_name)
332
+ # Сохраняет указанный ключ и все его подклавиши в указанный файл.
333
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
334
+ if not self.hkey is None:
335
+ winreg.SaveKey (self.hkey, AFileName)
336
+ self.CloseKeyReg(self.hkey)
337
+ #endfunction
338
+
339
+ def LoadKeyReg (self, AHKEY: THKEYConst, ASection: str, AFileName: str):
340
+ """LoadKeyReg"""
341
+ #beginfunction
342
+ # winreg.LoadKey(key, sub_key, file_name)
343
+ # Создает под-ключ под указанным ключом и сохраняет регистрационную информацию из указанного файла в этот под-ключ.
344
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
345
+ if not self.hkey is None:
346
+ winreg.LoadKey (self.hkey, ASection, AFileName)
347
+ self.CloseKeyReg(self.hkey)
348
+ #endfunction
349
+
350
+ def QueryValueReg (self, AHKEY: THKEYConst, ASection: str, AOption: str) -> ():
351
+ """QueryValueReg"""
352
+ #beginfunction
353
+ #+winreg.QueryValue (key, sub_key)
354
+ # Возвращает безымянное значение для ключа,в виде строки.
355
+ #+winreg.QueryValueEx (key, value_name)
356
+ # Результат-кортеж из 2 пунктов:
357
+ # 0 - Значение элемента реестра.
358
+ # 1 - Целое число, указывающее тип реестра для этого значения
359
+ LResult = ''
360
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
361
+ if not self.hkey is None:
362
+ if len(AOption) > 0:
363
+ LResult = winreg.QueryValueEx (self.hkey, AOption)
364
+ else:
365
+ LResult = winreg.QueryValue (self.hkey, None)
366
+ self.CloseKeyReg(self.hkey)
367
+ return LResult
368
+ #endfunction
369
+
370
+ def QueryInfoKeyReg (self, AHKEY: THKEYConst, ASection: str) -> ():
371
+ """QueryInfoKeyReg"""
372
+ #beginfunction
373
+ #+winreg.QueryInfoKey (key)
374
+ # Результат-кортеж из 3 пунктов:
375
+ LResult = ()
376
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
377
+ if not self.hkey is None:
378
+ LResult = winreg.QueryInfoKey (self.hkey)
379
+ self.CloseKeyReg(self.hkey)
380
+ return LResult
381
+ #endfunction
382
+
383
+ def DeleteValueReg (self, AHKEY: THKEYConst, ASection: str, AOption: str) -> bool:
384
+ """SetValueReg"""
385
+ #beginfunction
386
+ # winreg.DeleteValue (key, value)
387
+ # Удаляет именованное значение из ключа реестра.
388
+ LResult = False
389
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
390
+ if not self.hkey is None:
391
+ winreg.DeleteValue (self.hkey, AOption)
392
+ self.CloseKeyReg(self.hkey)
393
+ LResult = True
394
+ return LResult
395
+ #endfunction
396
+
397
+ def SetValueReg (self, AHKEY: THKEYConst, ASection: str, AOption: str, AFormat: TValueTypes, Value: str):
398
+ """SetValueReg"""
399
+ #beginfunction
400
+ # winreg.SetValue (key, sub_key, type, value)
401
+ # Сопоставляет стоимость с указанным ключом.
402
+ # winreg.SetValueEx (key, value_name, reserved, type, value)¶
403
+ # Хранит данные в поле значений открытого ключа реестра.
404
+ LResult = False
405
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
406
+ if not self.hkey is None:
407
+ winreg.SetValueEx (self.hkey, AOption, 0, AFormat.value, Value)
408
+ self.CloseKeyReg(self.hkey)
409
+ LResult = True
410
+ return LResult
411
+ #endfunction
412
+
413
+ def GetKeyReg (self, AHKEY: THKEYConst, ASection: str, AOption: str):
414
+ """GetKeyReg"""
415
+ #beginfunction
416
+ return self.QueryValueReg (AHKEY, ASection, AOption)
417
+ #endfunction
418
+
419
+ def GetOptionsReg (self, AHKEY: THKEYConst, ASection: str) -> ():
420
+ """QueryInfoKeyReg"""
421
+ #beginfunction
422
+ #+winreg.QueryInfoKey (key)
423
+ # Результат-кортеж из 3 пунктов:
424
+ LListKeyValue = self.EnumValueReg (AHKEY, ASection)
425
+ LList = []
426
+ for key in LListKeyValue:
427
+ LList.append(key[0])
428
+ return LList
429
+ #endfunction
430
+
431
+ def IsSection (self, AHKEY: THKEYConst, ASection: str) -> bool:
432
+ #beginfunction
433
+ LResult = False
434
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
435
+ if not self.hkey is None:
436
+ LResult = True
437
+ return LResult
438
+ #endfunction
439
+
440
+ def IsOption (self, AHKEY: THKEYConst, ASection: str, AOption: str) -> bool:
441
+ #beginfunction
442
+ LResult = False
443
+ self.hkey = self.OpenKeyReg (AHKEY, ASection)
444
+ if not self.hkey is None:
445
+ LList = self.GetOptionsReg (AHKEY, ASection)
446
+ if len (LList) > 0 and AOption in LList:
447
+ LResult = True
448
+ #endif
449
+ #endif
450
+ return LResult
451
+ #endfunction
452
+ #endclass
453
+
454
+ def SaveRegToFile_regedit (AFileName: str, AHKEY: THKEYConst, ASection: str):
455
+ """SaveRegToFile"""
456
+ #beginfunction
457
+ # LWorkDir = LUFile.ExtractFileDir (AFileName)
458
+ LProgramName = 'regedit.exe'
459
+ LParamStr = ''
460
+ match AHKEY:
461
+ case THKEYConst.cHKLM:
462
+ s = 'HKEY_LOCAL_MACHINE'
463
+ LParamStr = '/ea'+' '+AFileName+' '+s+'\\'+ASection
464
+ case THKEYConst.cHKCU:
465
+ s = 'HKEY_CURRENT_USER'
466
+ LParamStr = '/ea'+' '+AFileName+' "'+s+'\\'+ASection+'"'
467
+ #endmatch
468
+ if len (LParamStr) > 0:
469
+ #print (LParamStr)
470
+ # Lregedit = subprocess.Popen ('C:\\Windows\\System32\\regedit.exe', LParamStr)
471
+ # Lregedit = subprocess.Popen ('regedit.exe', LParamStr)
472
+ # Lregedit = subprocess.Popen ('regedit.exe')
473
+ # os.system (command)
474
+ # os.startfile ('regedit.exe', LParamStr)
475
+ # os.startfile ('regedit.exe')
476
+ ...
477
+ #endif
478
+ #endfunction
479
+
480
+ #---------------------------------------------------------
481
+ # CreateTREGParser
482
+ #---------------------------------------------------------
483
+ def CreateTREGParser () -> TREGParser:
484
+ """CreateTREGParser"""
485
+ #beginfunction
486
+ return TREGParser ()
487
+ #endfunction
488
+
489
+ GREGParser = CreateTREGParser ()
490
+
491
+ #---------------------------------------------------------
492
+ # main
493
+ #---------------------------------------------------------
494
+ def main ():
495
+ #beginfunction
496
+ # print (tuple(THKEYConst))
497
+ # print (tuple(TKEYAccess))
498
+ # print (tuple(TValueTypes))
499
+ ...
500
+ #endfunction
501
+
502
+ #---------------------------------------------------------
503
+ #
504
+ #---------------------------------------------------------
505
+ #beginmodule
506
+ if __name__ == '__main__':
507
+ main()
508
+ #endif
509
+
510
+ #endmodule
lyr/LUProc.py ADDED
@@ -0,0 +1,110 @@
1
+ """LUProc.py"""
2
+ # -*- coding: UTF-8 -*-
3
+ __annotations__ = """
4
+ =======================================================
5
+ Copyright (c) 2023
6
+ Author:
7
+ Lisitsin Y.R.
8
+ Project:
9
+ LU_PY
10
+ Python (LU)
11
+ Module:
12
+ LUProc.py
13
+
14
+ =======================================================
15
+ """
16
+
17
+ #------------------------------------------
18
+ # БИБЛИОТЕКИ python
19
+ #------------------------------------------
20
+ import enum
21
+
22
+ #------------------------------------------
23
+ # БИБЛИОТЕКИ сторонние
24
+ #------------------------------------------
25
+
26
+ #------------------------------------------
27
+ # БИБЛИОТЕКИ LU
28
+ #------------------------------------------
29
+
30
+ cProcessWork = 'Main: Идет процесс обработки...'
31
+ cProcessStop = 'Main: Процесс обработки остановлен...'
32
+ cProcessSetup = 'Setup...'
33
+ cProcessAbout = 'About...'
34
+ cProcessHelp = 'Help...'
35
+ cProcessDeleteAll = 'DeleteAll...'
36
+
37
+ cProcessBegin = '********* Начало **********************************'
38
+ cProcessEnd = '********* Конец ***********************************'
39
+
40
+ mrOk = True
41
+ mrCancel = False
42
+
43
+ @enum.unique
44
+ class TStatApplication(enum.Enum):
45
+ """TStatApplication"""
46
+ saRunning = enum.auto ()
47
+ saBreak = enum.auto ()
48
+ saMain = enum.auto ()
49
+ saDeleteAll = enum.auto ()
50
+ # saTest = enum.auto ()
51
+ # saSheduler = enum.auto ()
52
+ # saSetup = enum.auto ()
53
+ # saAbout = enum.auto ()
54
+ # saHelp = enum.auto ()
55
+ # saAction = enum.auto ()
56
+ # saSend = enum.auto ()
57
+ # saRefresh = enum.auto ()
58
+ # saViewLog = enum.auto ()
59
+ # saFree = enum.auto ()
60
+ # saStart = enum.auto ()
61
+ # saStop = enum.auto ()
62
+ # saAddWidget = enum.auto ()
63
+ #endclass
64
+ CStatApplication = {
65
+ TStatApplication.saRunning: 'saRunning',
66
+ TStatApplication.saBreak: 'saBreak',
67
+ TStatApplication.saMain: 'saMain',
68
+ TStatApplication.saDeleteAll: 'saDelteAll'
69
+ # TStatApplication.saTest: 'saTest',
70
+ # TStatApplication.saSheduler: 'saSheduler',
71
+ # TStatApplication.saSetup: 'saSetup',
72
+ # TStatApplication.saAbout: 'saAbout',
73
+ # TStatApplication.saHelp: 'saHelp',
74
+ # TStatApplication.saAction: 'saAction',
75
+ # TStatApplication.saSend: 'saSend',
76
+ # TStatApplication.saRefresh: 'saRefresh',
77
+ # TStatApplication.saViewLog: 'saViewLog',
78
+ # TStatApplication.saFree: 'saFree',
79
+ # TStatApplication.saStart: 'saStart',
80
+ # TStatApplication.saStop: 'saStop',
81
+ # TStatApplication.saAddWidget: 'saAddWidget'
82
+ }
83
+ @enum.unique
84
+ class TStatWidget(enum.Enum):
85
+ """TStatApplication"""
86
+ swRunning = enum.auto ()
87
+ swBreak = enum.auto ()
88
+ #endclass
89
+ CStatWidget = {
90
+ TStatWidget.swRunning: 'swRunning',
91
+ TStatWidget.swBreak: 'swBreak'
92
+ }
93
+
94
+ #---------------------------------------------------------
95
+ # main
96
+ #---------------------------------------------------------
97
+ def main ():
98
+ #beginfunction
99
+ ...
100
+ #endfunction
101
+
102
+ #---------------------------------------------------------
103
+ #
104
+ #---------------------------------------------------------
105
+ #beginmodule
106
+ if __name__ == "__main__":
107
+ main()
108
+ #endif
109
+
110
+ #endmodule