lyrpy 1.0.0__py3-none-any.whl → 2024.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.

Potentially problematic release.


This version of lyrpy might be problematic. Click here for more details.

Files changed (47) hide show
  1. {SRC/LIB/lyrpy → lyr}/LUConsole.py +1 -1
  2. lyr/LUConst.py +45 -0
  3. {SRC/LIB/lyrpy → lyr}/LUDateTime.py +4 -2
  4. {SRC/LIB/lyrpy → lyr}/LUDecotators.py +3 -2
  5. {SRC/LIB/lyrpy → lyr}/LUDict.py +1 -0
  6. {SRC/LIB/lyrpy → lyr}/LUDoc.py +4 -5
  7. {SRC/LIB/lyrpy → lyr}/LUErrors.py +1 -0
  8. {SRC/LIB/lyrpy → lyr}/LUFile.py +66 -120
  9. {SRC/LIB/lyrpy → lyr}/LUFileUtils.py +45 -60
  10. {SRC/LIB/lyrpy → lyr}/LULog.py +232 -307
  11. {SRC/LIB/lyrpy → lyr}/LUObjects.py +4 -4
  12. {SRC/LIB/lyrpy → lyr}/LUObjectsYT.py +22 -39
  13. {SRC/LIB/lyrpy → lyr}/LUParserARG.py +3 -2
  14. {SRC/LIB/lyrpy → lyr}/LUParserINI.py +9 -14
  15. {SRC/LIB/lyrpy → lyr}/LUParserREG.py +1 -5
  16. {SRC/LIB/lyrpy → lyr}/LUQThread.py +4 -6
  17. {SRC/LIB/lyrpy → lyr}/LUQTimer.py +5 -5
  18. {SRC/LIB/lyrpy → lyr}/LUSheduler.py +23 -24
  19. {SRC/LIB/lyrpy → lyr}/LUThread.py +6 -7
  20. {SRC/LIB/lyrpy → lyr}/LUTimer.py +3 -5
  21. {SRC/LIB/lyrpy → lyr}/LUVersion.py +1 -4
  22. {SRC/LIB/lyrpy → lyr}/LUYouTube.py +7 -6
  23. {SRC/LIB/lyrpy → lyr}/LUos.py +5 -15
  24. {SRC/LIB/lyrpy → lyr}/__init__.py +2 -2
  25. {SRC/LIB/lyrpy → lyr}/__main__.py +19 -20
  26. lyrpy-2024.0.2.data/data/data/text.txt +1 -0
  27. lyrpy-2024.0.2.dist-info/METADATA +44 -0
  28. lyrpy-2024.0.2.dist-info/RECORD +38 -0
  29. {lyrpy-1.0.0.dist-info → lyrpy-2024.0.2.dist-info}/WHEEL +1 -1
  30. lyrpy-2024.0.2.dist-info/top_level.txt +1 -0
  31. SRC/LIB/__init__.py +0 -0
  32. SRC/LIB/lyrpy/LUConst.py +0 -358
  33. SRC/LIB/lyrpy/LUTelegram.py +0 -428
  34. SRC/__init__.py +0 -0
  35. TESTS/__init__.py +0 -0
  36. TESTS/test_main.py +0 -10
  37. lyrpy-1.0.0.dist-info/METADATA +0 -24
  38. lyrpy-1.0.0.dist-info/RECORD +0 -42
  39. lyrpy-1.0.0.dist-info/top_level.txt +0 -2
  40. {SRC/LIB/lyrpy → lyr}/LUNetwork.py +0 -0
  41. {SRC/LIB/lyrpy → lyr}/LUNumUtils.py +0 -0
  42. {SRC/LIB/lyrpy → lyr}/LUProc.py +0 -0
  43. {SRC/LIB/lyrpy → lyr}/LUStrDecode.py +0 -0
  44. {SRC/LIB/lyrpy → lyr}/LUStrUtils.py +0 -0
  45. {SRC/LIB/lyrpy → lyr}/LUSupport.py +0 -0
  46. {SRC/LIB/lyrpy → lyr}/LUsys.py +0 -0
  47. {lyrpy-1.0.0.dist-info/licenses → lyrpy-2024.0.2.dist-info}/LICENSE +0 -0
@@ -38,11 +38,11 @@ import platform
38
38
  #------------------------------------------
39
39
  # БИБЛИОТЕКА LU
40
40
  #------------------------------------------
41
- import lyrpy.LUErrors as LUErrors
42
- import lyrpy.LUFile as LUFile
43
- import lyrpy.LUStrDecode as LUStrDecode
44
- import lyrpy.LULog as LULog
45
- import lyrpy.LUDateTime as LUDateTime
41
+ import lyr.LUErrors as LUErrors
42
+ import lyr.LUFile as LUFile
43
+ import lyr.LUStrDecode as LUStrDecode
44
+ import lyr.LULog as LULog
45
+ import lyr.LUDateTime as LUDateTime
46
46
 
47
47
  #------------------------------------------
48
48
  #CONST
@@ -58,13 +58,13 @@ GLevelMAX = sys.maxsize
58
58
  #-------------------------------------------------------------------------------
59
59
  # __OUTFILE
60
60
  #-------------------------------------------------------------------------------
61
- def __OUTFILE (s: str, OutFile: str):
61
+ def __OUTFILE (s: str, _OutFile: str):
62
62
  #beginfunction
63
- if OutFile and s != '':
64
- if OutFile.upper () == 'CONSOLE':
63
+ if (_OutFile) and (s != ''):
64
+ if (_OutFile.upper () == 'CONSOLE'):
65
65
  print (s)
66
66
  else:
67
- LUFile.WriteStrToFile (OutFile, s + '\n')
67
+ LUFile.WriteStrToFile (_OutFile, s + '\n')
68
68
  #endif
69
69
  #endif
70
70
  #endfunction
@@ -80,7 +80,7 @@ def __ListFile (APathSource, AMask, APathDest,
80
80
  LFileCount = 0
81
81
  with os.scandir(APathSource) as LFiles:
82
82
  for LFile in LFiles:
83
- if not LFile.is_symlink ():
83
+ if (not LFile.is_symlink ()):
84
84
  if LFile.is_file() and LUFile.CheckFileNameMask (LFile.name, AMask):
85
85
  #------------------------------------------------------------
86
86
  # class os.DirEntry - Это файл
@@ -104,7 +104,7 @@ def __ListFile (APathSource, AMask, APathDest,
104
104
  __OUTFILE (s, _OutFile)
105
105
 
106
106
  if _FuncFile:
107
- # s = f'_FuncFile: {_FuncFile.__name__:s}'
107
+ s = f'_FuncFile: {_FuncFile.__name__:s}'
108
108
  # LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
109
109
  _FuncFile (LUFile.ExpandFileName (LFile.path), APathDest)
110
110
  #endif
@@ -131,10 +131,9 @@ def __ListFile (APathSource, AMask, APathDest,
131
131
  #
132
132
  #------------------------------------------------------------
133
133
  if _FuncDir:
134
- # s = f'_FuncDir: {_FuncDir.__name__:s}'
134
+ s = f'_FuncDir: {_FuncDir.__name__:s}'
135
135
  # LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
136
- # _FuncDir (LUFile.ExpandFileName (LFile.path), APathDest)
137
- pass
136
+ _FuncDir (LUFile.ExpandFileName (LFile.path), APathDest)
138
137
  #endif
139
138
  #endif
140
139
  #endfor
@@ -178,8 +177,7 @@ def __ListDir (APathSource, AMask, ASubdir, APathDest,
178
177
  #endmatch
179
178
  __OUTFILE (s, _OutFile)
180
179
 
181
- # LFileCount = __ListFile (APathSource, AMask, APathDest, _OutFile, _Option, _FuncDir, _FuncFile)
182
- LFileCount = __ListFile (APathSource, AMask, APathDest, _OutFile, _Option, None, _FuncFile)
180
+ LFileCount = __ListFile (APathSource, AMask, APathDest, _OutFile, _Option, _FuncDir, _FuncFile)
183
181
 
184
182
  match _Option:
185
183
  case 1 | 11:
@@ -194,22 +192,13 @@ def __ListDir (APathSource, AMask, ASubdir, APathDest,
194
192
 
195
193
  with os.scandir(APathSource) as LFiles:
196
194
  for LFile in LFiles:
197
- if not LFile.is_symlink():
195
+ if (not LFile.is_symlink()):
198
196
  if LFile.is_dir (): # and (not LFile.name.startswith('.')):
199
- #------------------------------------------------------------
200
- #
201
- #------------------------------------------------------------
202
- if _FuncDir:
203
- # s = f'_FuncDir: {_FuncDir.__name__:s}'
204
- # LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
205
- _FuncDir (LUFile.ExpandFileName (LFile.path), APathDest)
206
- #endif
207
-
208
197
  #------------------------------------------------------------
209
198
  # class os.DirEntry - Это каталог
210
199
  #------------------------------------------------------------
211
- # LBaseName = os.path.basename (LFile.path)
212
- # LPathTimeSource = LUFile.GetFileDateTime (LFile.path)[2]
200
+ LBaseName = os.path.basename (LFile.path)
201
+ LPathTimeSource = LUFile.GetFileDateTime (LFile.path)[2]
213
202
 
214
203
  #------------------------------------------------------------
215
204
  # на следующий уровень
@@ -244,20 +233,20 @@ def BacFiles (APathSource, AMask, ASubDir, APathDest,
244
233
  LPathSource = _APathSource
245
234
  LBaseName = os.path.basename (_APathSource)
246
235
  LPathDest = os.path.join (_APathDest, LBaseName)
247
- # LPathTimeSource = LUFile.GetFileDateTime (_APathSource) [2]
236
+ LPathTimeSource = LUFile.GetFileDateTime (_APathSource) [2]
248
237
  Lattr = LUFile.GetFileAttr (_APathSource)
249
238
  if not _ASync:
250
239
  if not LUFile.DirectoryExists(LPathDest):
251
240
  s = f'Create {LPathDest:s} ...'
252
- LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
241
+ LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
253
242
  LUFile.ForceDirectories(LPathDest)
254
243
  LUFile.SetFileAttr(LPathDest, Lattr, False)
255
244
  #endif
256
245
  else:
257
246
  if not LUFile.DirectoryExists(LPathDest):
258
247
  s = f'Delete {LPathSource:s} ...'
259
- LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
260
- LUFile.DeleteDirectoryTree(LPathSource)
248
+ LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
249
+ LUFile.DirectoryDelete(LPathSource)
261
250
  #endif
262
251
  #endif
263
252
  #endfunction
@@ -269,7 +258,7 @@ def BacFiles (APathSource, AMask, ASubDir, APathDest,
269
258
  #beginfunction
270
259
  LFileNameSource = AFileName
271
260
  LBaseName = os.path.basename (AFileName)
272
- # LFileTimeSource = LUFile.GetFileDateTime (AFileName) [2]
261
+ LFileTimeSource = LUFile.GetFileDateTime (AFileName) [2]
273
262
  LFileSizeSource = LUFile.GetFileSize (AFileName)
274
263
  LFileAttrSource = LUFile.GetFileAttr (AFileName)
275
264
 
@@ -280,14 +269,11 @@ def BacFiles (APathSource, AMask, ASubDir, APathDest,
280
269
  #--------------------------------------------------------------------
281
270
  # Check Result
282
271
  #--------------------------------------------------------------------
283
- LCopy = False
284
- LDelete = False
285
-
286
272
  match LResult:
287
273
  case -3:
288
274
  # -3 File2 could not be opened (see @ERROR for more information).
289
- # LFileSizeDest = 0
290
- # LFileTimeDest = 0
275
+ LFileSizeDest = 0
276
+ LFileTimeDest = 0
291
277
  LDelete = False
292
278
  LCopy = True
293
279
  if _ASync:
@@ -306,10 +292,10 @@ def BacFiles (APathSource, AMask, ASubDir, APathDest,
306
292
  # 0 File1 and file2 have the same date and time.
307
293
  LDelete = False
308
294
  LCopy = False
309
- # LFileTimeDest = LUFile.GetFileDateTime (LFileNameDest) [2]
295
+ LFileTimeDest = LUFile.GetFileDateTime (LFileNameDest) [2]
310
296
  LFileSizeDest = LUFile.GetFileSize (LFileNameDest)
311
- # LFileAttrDest = LUFile.GetFileAttr (LFileNameDest)
312
- if LFileSizeSource != LFileSizeDest:
297
+ LFileAttrDest = LUFile.GetFileAttr (LFileNameDest)
298
+ if (LFileSizeSource != LFileSizeDest):
313
299
  LCopy = True
314
300
  else:
315
301
  LUFile.SetFileAttr(LFileNameDest, LFileAttrSource, False)
@@ -326,7 +312,7 @@ def BacFiles (APathSource, AMask, ASubDir, APathDest,
326
312
  #--------------------------------------------------------------------
327
313
  if LCopy == True:
328
314
  s = f'Copy {LFileNameSource:s} -> {LFileNameDest:s} ...'
329
- LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
315
+ LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
330
316
  LUFile.FileCopy (LFileNameSource, LFileNameDest, True)
331
317
  #endif
332
318
 
@@ -335,17 +321,17 @@ def BacFiles (APathSource, AMask, ASubDir, APathDest,
335
321
  #--------------------------------------------------------------------
336
322
  if LDelete == True:
337
323
  s = f'Delete {LFileNameSource:s} ...'
338
- LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
324
+ LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
339
325
  LUFile.FileDelete (LFileNameSource)
340
326
  #endif
341
327
  #endfunction
342
328
 
343
329
  #beginfunction
344
330
  if (APathSource != "") and (APathDest != ""):
345
- # LBaseName = os.path.basename (APathSource)
331
+ LBaseName = os.path.basename (APathSource)
346
332
  LPathDest = APathDest
347
- Ls = f'BacFiles: {APathSource:s} {AMask:s} => {APathDest:s} ...'
348
- LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, Ls)
333
+ s = f'BacFiles: {APathSource:s} {AMask:s} => {APathDest:s} ...'
334
+ LULog.LoggerTOOLS_AddLevel (LULog.TEXT, s)
349
335
  __ListDir (APathSource, AMask, ASubDir, LPathDest, _OutFile, _Option, FuncDir, FuncFile)
350
336
  #endif
351
337
  #endfunction
@@ -356,7 +342,7 @@ def BacFiles (APathSource, AMask, ASubDir, APathDest,
356
342
  def SyncFiles (APathSource, AMask, APathDest, _OutFile, _Option):
357
343
  #beginfunction
358
344
  s = f'SyncFiles: {APathSource:s} {AMask:s} => {APathDest:s} ...'
359
- LULog.LoggerAdd (LULog.LoggerTOOLS, LULog.TEXT, s)
345
+ LULog.LoggerTOOLS_AddLevel (LULog.TEXT, s)
360
346
 
361
347
  BacFiles (APathSource, AMask, True, APathDest, _OutFile, _Option, False)
362
348
  BacFiles (APathDest, AMask, True, APathSource, _OutFile, _Option, True)
@@ -368,9 +354,9 @@ def SyncFiles (APathSource, AMask, APathDest, _OutFile, _Option):
368
354
  def DirFiles (APathSource, AMask, ASubDir,
369
355
  _OutFile, _Option, _FuncDir, _FuncFile):
370
356
  #beginfunction
371
- if APathSource != "":
357
+ if (APathSource != ""):
372
358
  s = f'DirFiles: {APathSource:s} {AMask:s} ...'
373
- LULog.LoggerAdd (LULog.LoggerTOOLS, LULog.TEXT, s)
359
+ LULog.LoggerTOOLS_AddLevel (LULog.TEXT, s)
374
360
  __ListDir(APathSource, AMask, ASubDir, '', _OutFile, _Option, _FuncDir, _FuncFile)
375
361
  #endif
376
362
  #endfunction
@@ -392,7 +378,7 @@ def __FakeFile (APathSource,
392
378
  LUFile.CloseTextFile(LHahdle)
393
379
 
394
380
  if _FuncFile:
395
- # s = f'_FuncFile: {_FuncFile.__name__:s}'
381
+ s = f'_FuncFile: {_FuncFile.__name__:s}'
396
382
  # LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
397
383
  _FuncFile (LFileName)
398
384
  #endif
@@ -410,15 +396,14 @@ def __FakeDir (APathSource,
410
396
  #------------------------------------------------------------
411
397
  # Dir
412
398
  #------------------------------------------------------------
413
- # LBaseName = os.path.basename (APathSource)
414
- s = LUFile.ExpandFileName (APathSource)
415
- LULog.LoggerAdd (LULog.LoggerTOOLS, LULog.TEXT, s)
399
+ LBaseName = os.path.basename (APathSource)
400
+ LULog.LoggerTOOLS_AddLevel (LULog.TEXT, LUFile.ExpandFileName (APathSource))
416
401
 
417
402
  #------------------------------------------------------------
418
403
  #
419
404
  #------------------------------------------------------------
420
405
  if _FuncDir:
421
- # s = f'_FuncDir: {_FuncDir.__name__:s}'
406
+ s = f'_FuncDir: {_FuncDir.__name__:s}'
422
407
  # LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
423
408
  _FuncDir (LUFile.ExpandFileName (APathSource))
424
409
  #endif
@@ -447,9 +432,9 @@ def __FakeDir (APathSource,
447
432
  def FakeFiles (APathSource,
448
433
  _OutFile, _Option, _FuncDir, _FuncFile):
449
434
  #beginfunction
450
- if APathSource != "":
435
+ if (APathSource != ""):
451
436
  s = f'FakeFiles: {APathSource:s} ...'
452
- LULog.LoggerAdd (LULog.LoggerTOOLS, LULog.TEXT, s)
437
+ LULog.LoggerTOOLS_AddLevel (LULog.TEXT, s)
453
438
  __FakeDir(APathSource, _OutFile, _Option, _FuncDir, _FuncFile)
454
439
  #endif
455
440
  #endfunction
@@ -471,15 +456,15 @@ def DelFiles (APathSource, AMask, ASubDir, _OutFile, _Option, _Older: int):
471
456
  # print ((LDay - LFileTimeSource).days)
472
457
  if (LDay - LFileTimeSource).days > _Older:
473
458
  s = f'Delete {AFileName:s} ...'
474
- LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
459
+ LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
475
460
  LUFile.FileDelete(AFileName)
476
461
  #endif
477
462
  #endfunction
478
463
 
479
464
  #beginfunction
480
- if APathSource != "":
481
- s = f'DelFiles: {APathSource:s} {AMask:s} ...'
482
- LULog.LoggerAdd (LULog.LoggerTOOLS, LULog.TEXT, s)
465
+ if (APathSource != ""):
466
+ stat = f'DelFiles: {APathSource:s} {AMask:s} ...'
467
+ LULog.LoggerTOOLS_AddLevel (lyr.LULog.TEXT, s)
483
468
  __ListDir (APathSource, AMask, ASubDir, '', _OutFile, _Option, None, DelFile)
484
469
  #endif
485
470
  #endfunction