lyrpy 1.0.0__py3-none-any.whl → 2024.0.1__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.
- {SRC/LIB/lyrpy → lyr}/LUConsole.py +1 -1
- lyr/LUConst.py +45 -0
- {SRC/LIB/lyrpy → lyr}/LUDateTime.py +4 -2
- {SRC/LIB/lyrpy → lyr}/LUDecotators.py +3 -2
- {SRC/LIB/lyrpy → lyr}/LUDict.py +1 -0
- {SRC/LIB/lyrpy → lyr}/LUDoc.py +4 -5
- {SRC/LIB/lyrpy → lyr}/LUErrors.py +1 -0
- {SRC/LIB/lyrpy → lyr}/LUFile.py +66 -120
- {SRC/LIB/lyrpy → lyr}/LUFileUtils.py +45 -60
- {SRC/LIB/lyrpy → lyr}/LULog.py +232 -307
- {SRC/LIB/lyrpy → lyr}/LUObjects.py +4 -4
- {SRC/LIB/lyrpy → lyr}/LUObjectsYT.py +22 -39
- {SRC/LIB/lyrpy → lyr}/LUParserARG.py +3 -2
- {SRC/LIB/lyrpy → lyr}/LUParserINI.py +9 -14
- {SRC/LIB/lyrpy → lyr}/LUParserREG.py +1 -5
- {SRC/LIB/lyrpy → lyr}/LUQThread.py +4 -6
- {SRC/LIB/lyrpy → lyr}/LUQTimer.py +5 -5
- {SRC/LIB/lyrpy → lyr}/LUSheduler.py +23 -24
- {SRC/LIB/lyrpy → lyr}/LUThread.py +6 -7
- {SRC/LIB/lyrpy → lyr}/LUTimer.py +3 -5
- {SRC/LIB/lyrpy → lyr}/LUVersion.py +1 -4
- {SRC/LIB/lyrpy → lyr}/LUYouTube.py +7 -6
- {SRC/LIB/lyrpy → lyr}/LUos.py +5 -15
- {SRC/LIB/lyrpy → lyr}/__init__.py +2 -2
- {SRC/LIB/lyrpy → lyr}/__main__.py +19 -20
- lyrpy-2024.0.1.data/data/data/text.txt +1 -0
- lyrpy-2024.0.1.dist-info/METADATA +43 -0
- lyrpy-2024.0.1.dist-info/RECORD +38 -0
- {lyrpy-1.0.0.dist-info → lyrpy-2024.0.1.dist-info}/WHEEL +1 -1
- lyrpy-2024.0.1.dist-info/top_level.txt +1 -0
- SRC/LIB/__init__.py +0 -0
- SRC/LIB/lyrpy/LUConst.py +0 -358
- SRC/LIB/lyrpy/LUTelegram.py +0 -428
- SRC/__init__.py +0 -0
- TESTS/__init__.py +0 -0
- TESTS/test_main.py +0 -10
- lyrpy-1.0.0.dist-info/METADATA +0 -24
- lyrpy-1.0.0.dist-info/RECORD +0 -42
- lyrpy-1.0.0.dist-info/top_level.txt +0 -2
- {SRC/LIB/lyrpy → lyr}/LUNetwork.py +0 -0
- {SRC/LIB/lyrpy → lyr}/LUNumUtils.py +0 -0
- {SRC/LIB/lyrpy → lyr}/LUProc.py +0 -0
- {SRC/LIB/lyrpy → lyr}/LUStrDecode.py +0 -0
- {SRC/LIB/lyrpy → lyr}/LUStrUtils.py +0 -0
- {SRC/LIB/lyrpy → lyr}/LUSupport.py +0 -0
- {SRC/LIB/lyrpy → lyr}/LUsys.py +0 -0
- {lyrpy-1.0.0.dist-info/licenses → lyrpy-2024.0.1.dist-info}/LICENSE +0 -0
|
@@ -27,7 +27,7 @@ import enum
|
|
|
27
27
|
#------------------------------------------
|
|
28
28
|
# БИБЛИОТЕКИ LU
|
|
29
29
|
#------------------------------------------
|
|
30
|
-
import
|
|
30
|
+
import lyr.LULog as LULog
|
|
31
31
|
|
|
32
32
|
# ===========================================================================
|
|
33
33
|
# type
|
|
@@ -67,7 +67,7 @@ class TObjects (object):
|
|
|
67
67
|
""" destructor """
|
|
68
68
|
#beginfunction
|
|
69
69
|
LClassName = self.__class__.__name__
|
|
70
|
-
|
|
70
|
+
s = '{} уничтожен'.format (LClassName)
|
|
71
71
|
# LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
72
72
|
#print (s)
|
|
73
73
|
#endfunction
|
|
@@ -131,7 +131,7 @@ class TObjectsItem (object):
|
|
|
131
131
|
# удалить объект
|
|
132
132
|
del self.__FObjects
|
|
133
133
|
LClassName = self.__class__.__name__
|
|
134
|
-
|
|
134
|
+
s = '{} уничтожен'.format (LClassName)
|
|
135
135
|
# LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
136
136
|
|
|
137
137
|
#--------------------------------------------------
|
|
@@ -171,7 +171,7 @@ class TObjectsCollection (list):
|
|
|
171
171
|
""" destructor """
|
|
172
172
|
self.clear() # удалить все items
|
|
173
173
|
LClassName = self.__class__.__name__
|
|
174
|
-
|
|
174
|
+
s = '{} уничтожен'.format (LClassName)
|
|
175
175
|
# LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
176
176
|
|
|
177
177
|
def AddItem(self) -> TObjectsItem:
|
|
@@ -30,19 +30,20 @@ from typing import BinaryIO
|
|
|
30
30
|
#------------------------------------------
|
|
31
31
|
from urllib.parse import urlparse
|
|
32
32
|
|
|
33
|
-
from pytube import YouTube, request
|
|
33
|
+
from pytube import YouTube, request
|
|
34
|
+
from pytube import Playlist
|
|
34
35
|
import pytube
|
|
35
36
|
import pytube.exceptions
|
|
36
37
|
|
|
37
38
|
#------------------------------------------
|
|
38
39
|
# БИБЛИОТЕКИ LU
|
|
39
40
|
#------------------------------------------
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
41
|
+
import lyr.LULog as LULog
|
|
42
|
+
import lyr.LUObjects as LUObjects
|
|
43
|
+
import lyr.LUFile as LUFile
|
|
44
|
+
import lyr.LUStrUtils as LUStrUtils
|
|
45
|
+
import lyr.LUThread as LUThread
|
|
46
|
+
import lyr.LUDateTime as LUDateTime
|
|
46
47
|
|
|
47
48
|
CYOUTUBE_COM = 'WWW.YOUTUBE.COM'
|
|
48
49
|
CYOUTUBE_BE = 'YOUTU.BE'
|
|
@@ -106,7 +107,7 @@ class TYouTubeObject (LUObjects.TObjects):
|
|
|
106
107
|
"""Constructor"""
|
|
107
108
|
#beginfunction
|
|
108
109
|
super ().__init__ ()
|
|
109
|
-
self.__FObjectType:
|
|
110
|
+
self.__FObjectType: TObjectTypeClass = TObjectTypeClass.otYouTubeObject
|
|
110
111
|
#----------------------------------------------
|
|
111
112
|
self.__FYouTube: YouTube = None
|
|
112
113
|
self.__FStream: pytube.Stream = None
|
|
@@ -197,8 +198,7 @@ class TYouTubeObject (LUObjects.TObjects):
|
|
|
197
198
|
# prog.update (task, completed = stream.filesize - bytes_remaining)
|
|
198
199
|
# #this show the bytes_remaining, use rich to display a progress bar
|
|
199
200
|
#--------------------------------------------------
|
|
200
|
-
|
|
201
|
-
def ONprogressObject (self, AStream: Stream, AChunk: bytes, Abytes_remaining: int):
|
|
201
|
+
def ONprogressObject (self, AStream: pytube.Stream, AChunk: bytes, Abytes_remaining: int):
|
|
202
202
|
#beginfunction
|
|
203
203
|
s = 'TYouTubeObject.ONprogressObject...'
|
|
204
204
|
LULog.LoggerTOOLS_AddDebug (s)
|
|
@@ -222,8 +222,7 @@ class TYouTubeObject (LUObjects.TObjects):
|
|
|
222
222
|
# prog.stop ()
|
|
223
223
|
# print ('[green] Downloaded ', file_path.split ('/') [-1], '\n')
|
|
224
224
|
#--------------------------------------------------
|
|
225
|
-
|
|
226
|
-
def ONcompleteObject (self, AStream: Stream, AFilePath: str):
|
|
225
|
+
def ONcompleteObject (self, AStream: pytube.Stream, AFilePath: str):
|
|
227
226
|
#beginfunction
|
|
228
227
|
s = 'TYouTubeObject.ONcompleteObject...'
|
|
229
228
|
LULog.LoggerTOOLS_AddDebug (s)
|
|
@@ -243,25 +242,21 @@ class TYouTubeObject (LUObjects.TObjects):
|
|
|
243
242
|
#endfunction
|
|
244
243
|
|
|
245
244
|
@staticmethod
|
|
246
|
-
def GetURLInfo (AYouTube) -> {}:
|
|
247
|
-
"""
|
|
245
|
+
def GetURLInfo (AYouTube: YouTube) -> {}:
|
|
246
|
+
"""__GetURLInfo"""
|
|
248
247
|
#beginfunction
|
|
249
|
-
print (f'{AYouTube=}')
|
|
250
|
-
|
|
251
248
|
LURLInfo = dict ()
|
|
252
|
-
|
|
253
249
|
#Get the video author.
|
|
254
|
-
LURLInfo['author'] =
|
|
250
|
+
LURLInfo['author'] = AYouTube.author
|
|
255
251
|
#Get the video description.
|
|
256
|
-
LURLInfo['description'] =
|
|
252
|
+
LURLInfo['description'] = AYouTube.description
|
|
257
253
|
#Get the thumbnail url image.
|
|
258
|
-
LURLInfo['thumbnail_url'] =
|
|
254
|
+
LURLInfo['thumbnail_url'] = AYouTube.thumbnail_url
|
|
259
255
|
# Заголовок [Get the video title]
|
|
260
|
-
|
|
261
|
-
LURLInfo['title'] =
|
|
256
|
+
s = AYouTube.title
|
|
257
|
+
LURLInfo['title'] = LUStrUtils.PrintableStr(s)
|
|
262
258
|
# продолжительность видео [Get the video length in seconds]
|
|
263
|
-
LURLInfo['length'] =
|
|
264
|
-
LURLInfo['length'] = 0
|
|
259
|
+
LURLInfo['length'] = AYouTube.length
|
|
265
260
|
|
|
266
261
|
# #Get a list of Caption.
|
|
267
262
|
# LURLInfo['caption_tracks'] = AYouTube.caption_tracks
|
|
@@ -295,13 +290,11 @@ class TYouTubeObject (LUObjects.TObjects):
|
|
|
295
290
|
def __SetURLInfo (self):
|
|
296
291
|
"""__SetURLInfo"""
|
|
297
292
|
#beginfunction
|
|
298
|
-
print ("""__SetURLInfo""")
|
|
299
293
|
self.__FURLInfo = self.GetURLInfo (self.__FYouTube)
|
|
300
294
|
#endfunction
|
|
301
295
|
|
|
302
296
|
@staticmethod
|
|
303
|
-
|
|
304
|
-
def GetStreamInfo (AStream: Stream) -> {}:
|
|
297
|
+
def GetStreamInfo (AStream: pytube.Stream) -> {}:
|
|
305
298
|
"""GetStreamInfo"""
|
|
306
299
|
#beginfunction
|
|
307
300
|
LStreamInfo = dict ()
|
|
@@ -346,8 +339,7 @@ class TYouTubeObject (LUObjects.TObjects):
|
|
|
346
339
|
return LStreamInfo
|
|
347
340
|
#endfunction
|
|
348
341
|
|
|
349
|
-
|
|
350
|
-
def __SetStreamInfo (self, AStream: Stream):
|
|
342
|
+
def __SetStreamInfo (self, AStream: pytube.Stream):
|
|
351
343
|
"""SetStreamInfo"""
|
|
352
344
|
#beginfunction
|
|
353
345
|
self.__FStreamInfo = self.GetStreamInfo(AStream)
|
|
@@ -402,18 +394,9 @@ class TYouTubeObject (LUObjects.TObjects):
|
|
|
402
394
|
def SetURL(self, AURL: str, AMaxRes: (), APlayList: str, ANumber: int, ACount: int):
|
|
403
395
|
#beginfunction
|
|
404
396
|
self.__FURL = AURL
|
|
405
|
-
|
|
406
|
-
print(f'{AURL=}')
|
|
407
|
-
print(f'{APlayList=}')
|
|
408
|
-
print(f'{ANumber=}')
|
|
409
|
-
print(f'{ACount=}')
|
|
410
|
-
|
|
411
397
|
self.__FYouTube: YouTube = YouTube(AURL)
|
|
412
|
-
# self.__FYouTube = Playlist(AURL)
|
|
413
398
|
# self.SetStream(AMaxRes)
|
|
414
|
-
|
|
415
399
|
self.__SetURLInfo()
|
|
416
|
-
|
|
417
400
|
self.PlayList = APlayList
|
|
418
401
|
self.Number = ANumber
|
|
419
402
|
self.Count = ACount
|
|
@@ -626,7 +609,7 @@ class TYouTubeObject (LUObjects.TObjects):
|
|
|
626
609
|
#endfunction
|
|
627
610
|
|
|
628
611
|
def __DownloadURL_chunk (self, APATH: str, AFileName:str, AFileSize: int):
|
|
629
|
-
"""
|
|
612
|
+
"""DownloadURL_chunk"""
|
|
630
613
|
#beginfunction
|
|
631
614
|
self.FFileNamechunk = AFileName
|
|
632
615
|
LFileSize = AFileSize
|
|
@@ -19,6 +19,7 @@ __annotations__ = """
|
|
|
19
19
|
#------------------------------------------
|
|
20
20
|
import sys
|
|
21
21
|
import argparse
|
|
22
|
+
import logging
|
|
22
23
|
|
|
23
24
|
# re - Regular expression operations
|
|
24
25
|
import re
|
|
@@ -30,7 +31,7 @@ import re
|
|
|
30
31
|
#------------------------------------------
|
|
31
32
|
# БИБЛИОТЕКА LU
|
|
32
33
|
#------------------------------------------
|
|
33
|
-
import
|
|
34
|
+
import lyr.LULog as LULog
|
|
34
35
|
|
|
35
36
|
#------------------------------------------
|
|
36
37
|
# Разбор аргументов
|
|
@@ -339,7 +340,7 @@ def CreateTArgParser (AProg: str, ADescrption: str) -> TArgParser:
|
|
|
339
340
|
LResult = TArgParser (prog = AProg, description=ADescrption, prefix_chars='-/',
|
|
340
341
|
usage = None, epilog = None, parents = [], formatter_class = argparse.HelpFormatter,
|
|
341
342
|
fromfile_prefix_chars = None, argument_default = None,
|
|
342
|
-
conflict_handler = 'error', add_help = True)
|
|
343
|
+
conflict_handler = 'error', add_help = True, allow_abbrev = True, exit_on_error = True)
|
|
343
344
|
return LResult
|
|
344
345
|
#endfunction
|
|
345
346
|
|
|
@@ -27,12 +27,12 @@ import logging
|
|
|
27
27
|
#------------------------------------------
|
|
28
28
|
# БИБЛИОТЕКА LU
|
|
29
29
|
#------------------------------------------
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
30
|
+
import lyr.LULog as LULog
|
|
31
|
+
import lyr.LUConst as LUConst
|
|
32
|
+
import lyr.LUFile as LUFile
|
|
33
|
+
import lyr.LUos as LUos
|
|
34
|
+
import lyr.LUStrDecode as LUStrDecode
|
|
35
|
+
import lyr.LUStrUtils as LUStrUtils
|
|
36
36
|
|
|
37
37
|
class TINIFile (configparser.ConfigParser):
|
|
38
38
|
"""TINIFile"""
|
|
@@ -60,7 +60,6 @@ class TINIFile (configparser.ConfigParser):
|
|
|
60
60
|
def __GetINIFileName (AFileName: str) -> str:
|
|
61
61
|
"""__GetINIFileName"""
|
|
62
62
|
#beginfunction
|
|
63
|
-
LResult = ''
|
|
64
63
|
P = LUFile.ExtractFileDir (AFileName)
|
|
65
64
|
F = LUFile.ExtractFileName (AFileName)
|
|
66
65
|
E = LUFile.ExtractFileExt (AFileName)
|
|
@@ -69,12 +68,8 @@ class TINIFile (configparser.ConfigParser):
|
|
|
69
68
|
#endif
|
|
70
69
|
if P == '':
|
|
71
70
|
LWinDir = LUos.GetEnvVar (LUos.cWINDIR)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
LList = LUFile.SearchFileDirs (LPath, F, '', '', False)
|
|
75
|
-
if len(LList) > 0:
|
|
76
|
-
LResult = LList[0]
|
|
77
|
-
#endif
|
|
71
|
+
APath = LUos.GetCurrentDir () + ';' + LWinDir
|
|
72
|
+
LResult = LUFile.FileSearch (F, APath)
|
|
78
73
|
if LResult == '':
|
|
79
74
|
LResult = LUFile.IncludeTrailingBackslash (LWinDir) + F
|
|
80
75
|
#endif
|
|
@@ -102,7 +97,7 @@ class TINIFile (configparser.ConfigParser):
|
|
|
102
97
|
"""destructor"""
|
|
103
98
|
#beginfunction
|
|
104
99
|
LClassName = self.__class__.__name__
|
|
105
|
-
|
|
100
|
+
s = '{} уничтожен'.format (LClassName)
|
|
106
101
|
# LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
107
102
|
#print (s)
|
|
108
103
|
#endfunction
|
|
@@ -17,12 +17,8 @@ __annotations__ = """
|
|
|
17
17
|
#------------------------------------------
|
|
18
18
|
# БИБЛИОТЕКИ python
|
|
19
19
|
#------------------------------------------
|
|
20
|
+
import winreg
|
|
20
21
|
import enum
|
|
21
|
-
import platform
|
|
22
|
-
|
|
23
|
-
if platform.system() == 'Windows':
|
|
24
|
-
import winreg
|
|
25
|
-
#endif
|
|
26
22
|
|
|
27
23
|
#------------------------------------------
|
|
28
24
|
# БИБЛИОТЕКИ сторонние
|
|
@@ -14,8 +14,6 @@ __annotations__ = """
|
|
|
14
14
|
=======================================================
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
|
-
import logging
|
|
18
|
-
|
|
19
17
|
#------------------------------------------
|
|
20
18
|
# БИБЛИОТЕКИ python
|
|
21
19
|
#------------------------------------------
|
|
@@ -30,7 +28,7 @@ from PySide6.QtCore import QObject, QThread, Signal, Slot
|
|
|
30
28
|
#------------------------------------------
|
|
31
29
|
# БИБЛИОТЕКА LU
|
|
32
30
|
#------------------------------------------
|
|
33
|
-
import
|
|
31
|
+
import lyr.LULog as LULog
|
|
34
32
|
|
|
35
33
|
# Signals must inherit QObject
|
|
36
34
|
class MySignals(QObject):
|
|
@@ -69,7 +67,7 @@ class TQThread (QThread):
|
|
|
69
67
|
"""destructor"""
|
|
70
68
|
#beginfunction
|
|
71
69
|
LClassName = self.__class__.__name__
|
|
72
|
-
|
|
70
|
+
s = '{} уничтожен'.format (LClassName)
|
|
73
71
|
# LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
74
72
|
#print (s)
|
|
75
73
|
#endfunction
|
|
@@ -92,7 +90,7 @@ class TQThread (QThread):
|
|
|
92
90
|
#beginfunction
|
|
93
91
|
super ().run()
|
|
94
92
|
s = 'run - Запуск потока...'
|
|
95
|
-
LULog.
|
|
93
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
96
94
|
|
|
97
95
|
# Do something on the worker thread
|
|
98
96
|
a = 1 + 1
|
|
@@ -101,7 +99,7 @@ class TQThread (QThread):
|
|
|
101
99
|
self.signals.signal_str.emit ("This text comes to Main thread from our Worker thread.")
|
|
102
100
|
|
|
103
101
|
while not self.__FStopThread:
|
|
104
|
-
|
|
102
|
+
s = 'Выполнение потока...'
|
|
105
103
|
# LULog.LoggerTOOLS_AddDebug (s)
|
|
106
104
|
Lval = psutil.cpu_percent ()
|
|
107
105
|
self.emit(QtCore.SIGNAL('CPU_VALUE'), Lval)
|
|
@@ -35,7 +35,7 @@ from PySide6.QtWidgets import (
|
|
|
35
35
|
#------------------------------------------
|
|
36
36
|
# БИБЛИОТЕКА LU
|
|
37
37
|
#------------------------------------------
|
|
38
|
-
import
|
|
38
|
+
import lyr.LULog as LULog
|
|
39
39
|
|
|
40
40
|
# blocking.py
|
|
41
41
|
def wait(milliseconds, /):
|
|
@@ -88,7 +88,7 @@ class TQTimer (QTimer):
|
|
|
88
88
|
"""destructor"""
|
|
89
89
|
#beginfunction
|
|
90
90
|
LClassName = self.__class__.__name__
|
|
91
|
-
|
|
91
|
+
s = '{} уничтожен'.format (LClassName)
|
|
92
92
|
# LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
93
93
|
#print (s)
|
|
94
94
|
#endfunction
|
|
@@ -110,7 +110,7 @@ class TQTimer (QTimer):
|
|
|
110
110
|
"""start - Запуск таймера..."""
|
|
111
111
|
#beginfunction
|
|
112
112
|
s = 'Запуск таймера '+self.FQTimerName+'...'
|
|
113
|
-
LULog.
|
|
113
|
+
LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
114
114
|
super ().start ()
|
|
115
115
|
self.__Fidle = True
|
|
116
116
|
#endfunction
|
|
@@ -122,7 +122,7 @@ class TQTimer (QTimer):
|
|
|
122
122
|
"""stop - Остановить таймер..."""
|
|
123
123
|
#beginfunction
|
|
124
124
|
s = 'Остановка таймера '+self.FQTimerName+'...'
|
|
125
|
-
LULog.
|
|
125
|
+
LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
126
126
|
super ().stop ()
|
|
127
127
|
#endfunction
|
|
128
128
|
|
|
@@ -133,7 +133,7 @@ class TQTimer (QTimer):
|
|
|
133
133
|
def __run_TEST(self):
|
|
134
134
|
"""__run_TEST..."""
|
|
135
135
|
#beginfunction
|
|
136
|
-
|
|
136
|
+
s = '__run_TEST...'
|
|
137
137
|
# LULog.LoggerTOOLS_AddDebug (s)
|
|
138
138
|
|
|
139
139
|
# Do something on the worker thread
|
|
@@ -20,7 +20,6 @@ __annotations__ = """
|
|
|
20
20
|
import datetime
|
|
21
21
|
from calendar import monthrange
|
|
22
22
|
import threading
|
|
23
|
-
import logging
|
|
24
23
|
|
|
25
24
|
#------------------------------------------
|
|
26
25
|
# БИБЛИОТЕКИ сторонние
|
|
@@ -29,9 +28,9 @@ import logging
|
|
|
29
28
|
#------------------------------------------
|
|
30
29
|
# БИБЛИОТЕКИ LU
|
|
31
30
|
#------------------------------------------
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
31
|
+
import lyr.LULog as LULog
|
|
32
|
+
import lyr.LUStrUtils as LUStrUtils
|
|
33
|
+
import lyr.LUDateTime as LUDateTime
|
|
35
34
|
|
|
36
35
|
minNN = 0
|
|
37
36
|
maxNN = 59
|
|
@@ -116,7 +115,7 @@ class TShedulerEventItem (object):
|
|
|
116
115
|
# удалить объект
|
|
117
116
|
del self.__FList
|
|
118
117
|
LClassName = self.__class__.__name__
|
|
119
|
-
|
|
118
|
+
s = '{} уничтожен'.format (LClassName)
|
|
120
119
|
# LUConst.LULogger.log (LULog.DEBUGTEXT, s)
|
|
121
120
|
#print (s)
|
|
122
121
|
#endfunction
|
|
@@ -453,7 +452,7 @@ class TSheduler (object):
|
|
|
453
452
|
del self.__FShedulerEvents
|
|
454
453
|
del self.__FNameEvents
|
|
455
454
|
LClassName = self.__class__.__name__
|
|
456
|
-
|
|
455
|
+
s = '{} уничтожен'.format(LClassName)
|
|
457
456
|
# LUConst.LULogger.log (LULog.DEBUGTEXT, s)
|
|
458
457
|
#endfunction
|
|
459
458
|
|
|
@@ -561,7 +560,7 @@ class TSheduler (object):
|
|
|
561
560
|
def run_Function(self):
|
|
562
561
|
"""__run_Function"""
|
|
563
562
|
#beginfunction
|
|
564
|
-
|
|
563
|
+
s = '__run_Function...'
|
|
565
564
|
# LULog.LoggerTOOLS_AddDebug (s)
|
|
566
565
|
if self.__FEnable:
|
|
567
566
|
LPresentNow = LUDateTime.Now ()
|
|
@@ -653,14 +652,14 @@ class TSheduler (object):
|
|
|
653
652
|
#endif
|
|
654
653
|
s = 'Следующий сеанс: ' + str (self.__FDTEvents)
|
|
655
654
|
if APrint:
|
|
656
|
-
LULog.
|
|
655
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
657
656
|
#endif
|
|
658
657
|
#endfunction
|
|
659
658
|
|
|
660
659
|
def __Second (self):
|
|
661
660
|
"""Second"""
|
|
662
661
|
#beginfunction
|
|
663
|
-
|
|
662
|
+
s = 'Second...'
|
|
664
663
|
# LULog.LoggerTOOLS_AddDebug (s)
|
|
665
664
|
if self.__FEnable:
|
|
666
665
|
LPresent: datetime = LUDateTime.Now()
|
|
@@ -730,17 +729,17 @@ class TSheduler (object):
|
|
|
730
729
|
def PrintEvent (AEvent: TShedulerEventItem):
|
|
731
730
|
"""PrintEvent"""
|
|
732
731
|
#beginfunction
|
|
733
|
-
LULog.
|
|
732
|
+
LULog.LoggerTOOLS_AddDebug (AEvent.NameEvent)
|
|
734
733
|
s = f'NN={AEvent.GetXXString ("NN")}'
|
|
735
|
-
LULog.
|
|
734
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
736
735
|
s = f'HH={AEvent.GetXXString ("HH")}'
|
|
737
|
-
LULog.
|
|
736
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
738
737
|
s = f'DD={AEvent.GetXXString ("DD")}'
|
|
739
|
-
LULog.
|
|
738
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
740
739
|
s = f'MM={AEvent.GetXXString ("MM")}'
|
|
741
|
-
LULog.
|
|
740
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
742
741
|
s = f'DW={AEvent.GetXXString ("DW")}'
|
|
743
|
-
LULog.
|
|
742
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
744
743
|
#endfunction
|
|
745
744
|
#endclass
|
|
746
745
|
|
|
@@ -772,7 +771,7 @@ class TShedulerThread (threading.Thread):
|
|
|
772
771
|
"""destructor"""
|
|
773
772
|
#beginfunction
|
|
774
773
|
LClassName = self.__class__.__name__
|
|
775
|
-
|
|
774
|
+
s = '{} уничтожен'.format(LClassName)
|
|
776
775
|
# LUConst.LULogger.log (LULog.DEBUGTEXT, s)
|
|
777
776
|
#endfunction
|
|
778
777
|
|
|
@@ -794,11 +793,11 @@ class TShedulerThread (threading.Thread):
|
|
|
794
793
|
"""run - Запуск потока TSheduler"""
|
|
795
794
|
#beginfunction
|
|
796
795
|
s = 'run - Запуск потока TSheduler...'
|
|
797
|
-
LULog.
|
|
796
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
798
797
|
super ().run()
|
|
799
798
|
|
|
800
799
|
if self.__FSheduler.DTEvents == 0:
|
|
801
|
-
self.__FSheduler.CreateNextEvent (
|
|
800
|
+
self.__FSheduler.CreateNextEvent ()
|
|
802
801
|
#endif
|
|
803
802
|
while not self.__FStopThread:
|
|
804
803
|
self.__FSheduler.run_Function ()
|
|
@@ -813,7 +812,7 @@ class TShedulerThread (threading.Thread):
|
|
|
813
812
|
"""StartSheduler"""
|
|
814
813
|
#beginfunction
|
|
815
814
|
s = 'StartSheduler...'
|
|
816
|
-
LULog.
|
|
815
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
817
816
|
self.__FStopThread = False
|
|
818
817
|
self.__FSheduler.Enable = True
|
|
819
818
|
# self.__CreateNextEvent ()
|
|
@@ -826,7 +825,7 @@ class TShedulerThread (threading.Thread):
|
|
|
826
825
|
"""StopSheduler"""
|
|
827
826
|
#beginfunction
|
|
828
827
|
s = 'StopSheduler...'
|
|
829
|
-
LULog.
|
|
828
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
830
829
|
self.__FStopThread = True
|
|
831
830
|
self.__FSheduler.Enable = False
|
|
832
831
|
#endfunction
|
|
@@ -863,7 +862,7 @@ class TShedulerTimer (threading.Timer):
|
|
|
863
862
|
"""destructor"""
|
|
864
863
|
#beginfunction
|
|
865
864
|
LClassName = self.__class__.__name__
|
|
866
|
-
|
|
865
|
+
s = '{} уничтожен'.format (LClassName)
|
|
867
866
|
# LUConst.LULogger.log (LULog.DEBUGTEXT, s)
|
|
868
867
|
#endfunction
|
|
869
868
|
|
|
@@ -884,7 +883,7 @@ class TShedulerTimer (threading.Timer):
|
|
|
884
883
|
"""run - Запуск таймера TShedulerTimer"""
|
|
885
884
|
#beginfunction
|
|
886
885
|
s = 'run - Запуск таймера TShedulerTimer...'
|
|
887
|
-
LULog.
|
|
886
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
888
887
|
|
|
889
888
|
if self.__FSheduler.DTEvents == 0:
|
|
890
889
|
self.__FSheduler.CreateNextEvent (True)
|
|
@@ -902,7 +901,7 @@ class TShedulerTimer (threading.Timer):
|
|
|
902
901
|
"""StartSheduler"""
|
|
903
902
|
#beginfunction
|
|
904
903
|
s = 'StartSheduler...'
|
|
905
|
-
LULog.
|
|
904
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
906
905
|
self.__FStopThread = False
|
|
907
906
|
self.__FSheduler.Enable = True
|
|
908
907
|
# self.__CreateNextEvent (True)
|
|
@@ -915,7 +914,7 @@ class TShedulerTimer (threading.Timer):
|
|
|
915
914
|
"""StopSheduler"""
|
|
916
915
|
#beginfunction
|
|
917
916
|
s = 'StopSheduler...'
|
|
918
|
-
LULog.
|
|
917
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
919
918
|
self.__FStopThread = True
|
|
920
919
|
self.__FSheduler.Enable = False
|
|
921
920
|
#endfunction
|
|
@@ -18,7 +18,6 @@ __annotations__ = """
|
|
|
18
18
|
# БИБЛИОТЕКИ python
|
|
19
19
|
#------------------------------------------
|
|
20
20
|
import threading
|
|
21
|
-
import logging
|
|
22
21
|
|
|
23
22
|
#------------------------------------------
|
|
24
23
|
# БИБЛИОТЕКИ сторонние
|
|
@@ -27,7 +26,7 @@ import logging
|
|
|
27
26
|
#------------------------------------------
|
|
28
27
|
# БИБЛИОТЕКА LU
|
|
29
28
|
#------------------------------------------
|
|
30
|
-
import
|
|
29
|
+
import lyr.LULog as LULog
|
|
31
30
|
|
|
32
31
|
# class ScheduleThread (threading.Thread):
|
|
33
32
|
# @classmethod
|
|
@@ -91,7 +90,7 @@ class TThread (threading.Thread):
|
|
|
91
90
|
"""destructor"""
|
|
92
91
|
#beginfunction
|
|
93
92
|
LClassName = self.__class__.__name__
|
|
94
|
-
|
|
93
|
+
s = '{} уничтожен'.format (LClassName)
|
|
95
94
|
# LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
96
95
|
#print (s)
|
|
97
96
|
#endfunction
|
|
@@ -125,10 +124,10 @@ class TThread (threading.Thread):
|
|
|
125
124
|
"""run - Запуск потока"""
|
|
126
125
|
#beginfunction
|
|
127
126
|
s = 'run - Запуск потока...'
|
|
128
|
-
LULog.
|
|
127
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
129
128
|
super ().run()
|
|
130
129
|
while not self.__FStopThread:
|
|
131
|
-
|
|
130
|
+
s = 'Выполнение потока...'
|
|
132
131
|
# LULog.LoggerTOOLS_AddDebug (s)
|
|
133
132
|
continue
|
|
134
133
|
#endwhile
|
|
@@ -141,7 +140,7 @@ class TThread (threading.Thread):
|
|
|
141
140
|
"""StartThread"""
|
|
142
141
|
#beginfunction
|
|
143
142
|
s = 'StartThread...'
|
|
144
|
-
LULog.
|
|
143
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
145
144
|
self.__FStopThread = False
|
|
146
145
|
self.run()
|
|
147
146
|
#endfunction
|
|
@@ -152,7 +151,7 @@ class TThread (threading.Thread):
|
|
|
152
151
|
"""StopThread"""
|
|
153
152
|
#beginfunction
|
|
154
153
|
s = 'StopThread...'
|
|
155
|
-
LULog.
|
|
154
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
156
155
|
self.__FStopThread = True
|
|
157
156
|
#endfunction
|
|
158
157
|
|
{SRC/LIB/lyrpy → lyr}/LUTimer.py
RENAMED
|
@@ -18,7 +18,6 @@ __annotations__ = """
|
|
|
18
18
|
# БИБЛИОТЕКИ python
|
|
19
19
|
#------------------------------------------
|
|
20
20
|
import threading
|
|
21
|
-
import logging
|
|
22
21
|
|
|
23
22
|
#------------------------------------------
|
|
24
23
|
# БИБЛИОТЕКИ сторонние
|
|
@@ -27,7 +26,6 @@ import logging
|
|
|
27
26
|
#------------------------------------------
|
|
28
27
|
# БИБЛИОТЕКА LU
|
|
29
28
|
#------------------------------------------
|
|
30
|
-
import lyrpy.LULog as LULog
|
|
31
29
|
|
|
32
30
|
# Create the Worker Thread
|
|
33
31
|
class TTimer (threading.Timer):
|
|
@@ -62,7 +60,7 @@ class TTimer (threading.Timer):
|
|
|
62
60
|
"""destructor"""
|
|
63
61
|
#beginfunction
|
|
64
62
|
LClassName = self.__class__.__name__
|
|
65
|
-
|
|
63
|
+
s = '{} уничтожен'.format (LClassName)
|
|
66
64
|
# LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
|
|
67
65
|
#print (s)
|
|
68
66
|
#endfunction
|
|
@@ -96,13 +94,13 @@ class TTimer (threading.Timer):
|
|
|
96
94
|
"""run - Запуск таймера"""
|
|
97
95
|
#beginfunction
|
|
98
96
|
s = 'run - Запуск таймера...'
|
|
99
|
-
LULog.
|
|
97
|
+
LULog.LoggerTOOLS_AddDebug (s)
|
|
100
98
|
# super ().run()
|
|
101
99
|
|
|
102
100
|
# self.Function()
|
|
103
101
|
|
|
104
102
|
while not self.__FStopTimer:
|
|
105
|
-
|
|
103
|
+
s = 'Выполнение таймера...'
|
|
106
104
|
# LULog.LoggerTOOLS_AddDebug (s)
|
|
107
105
|
continue
|
|
108
106
|
#endwhile
|
|
@@ -24,9 +24,6 @@ import platform
|
|
|
24
24
|
#------------------------------------------
|
|
25
25
|
import datetime
|
|
26
26
|
|
|
27
|
-
import win32api
|
|
28
|
-
|
|
29
|
-
|
|
30
27
|
# if platform.system() == 'Windows':
|
|
31
28
|
# import win32api
|
|
32
29
|
# import win32con
|
|
@@ -74,7 +71,7 @@ class TVersionInfo:
|
|
|
74
71
|
def __del__(self):
|
|
75
72
|
#beginfunction
|
|
76
73
|
LClassName = self.__class__.__name__
|
|
77
|
-
|
|
74
|
+
s = '{} уничтожен'.format (LClassName)
|
|
78
75
|
#print (s)
|
|
79
76
|
#endfunction
|
|
80
77
|
|