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