lyrpy 1.0.0__tar.gz → 2025.0.5__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 (70) hide show
  1. lyrpy-2025.0.5/MANIFEST.in +12 -0
  2. lyrpy-2025.0.5/PKG-INFO +30 -0
  3. lyrpy-2025.0.5/README.md +1 -0
  4. lyrpy-2025.0.5/config/settings.cfg +1 -0
  5. lyrpy-2025.0.5/docs/README.md +1 -0
  6. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUConsole.py +1 -1
  7. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUConst.py +1 -1
  8. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUDateTime.py +1 -1
  9. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUDecotators.py +1 -1
  10. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUDict.py +1 -1
  11. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUDoc.py +0 -2
  12. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUErrors.py +1 -1
  13. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUFile.py +37 -5
  14. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUFileUtils.py +1 -13
  15. lyrpy-2025.0.5/lyrpy/LULog.py +2322 -0
  16. lyrpy-1.0.0/SRC/LIB/lyrpy/LULog.py → lyrpy-2025.0.5/lyrpy/LULogPySide6.py +9 -9
  17. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUNetwork.py +1 -6
  18. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUNumUtils.py +1 -5
  19. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUObjects.py +0 -2
  20. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUObjectsYT.py +4 -10
  21. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUParserARG.py +1 -4
  22. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUParserINI.py +0 -1
  23. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUProc.py +1 -1
  24. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUStrUtils.py +0 -1
  25. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUTelegram.py +1 -3
  26. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUVersion.py +1 -3
  27. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUos.py +3 -1
  28. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/__init__.py +2 -1
  29. lyrpy-2025.0.5/lyrpy/data/config.json +1 -0
  30. lyrpy-2025.0.5/lyrpy/logging.CONFIG +65 -0
  31. lyrpy-2025.0.5/lyrpy/logging.INI +64 -0
  32. lyrpy-2025.0.5/lyrpy/logging.YAML +67 -0
  33. lyrpy-2025.0.5/lyrpy/logging_CONSOLE.INI +35 -0
  34. lyrpy-2025.0.5/lyrpy/static/script.js +1 -0
  35. lyrpy-2025.0.5/lyrpy/static/style.css +1 -0
  36. lyrpy-2025.0.5/lyrpy/templates/template.html +1 -0
  37. lyrpy-2025.0.5/lyrpy.egg-info/PKG-INFO +30 -0
  38. lyrpy-2025.0.5/lyrpy.egg-info/SOURCES.txt +60 -0
  39. lyrpy-2025.0.5/lyrpy.egg-info/entry_points.txt +2 -0
  40. lyrpy-2025.0.5/lyrpy.egg-info/requires.txt +4 -0
  41. lyrpy-2025.0.5/lyrpy.egg-info/top_level.txt +2 -0
  42. lyrpy-2025.0.5/pyproject.toml +193 -0
  43. lyrpy-2025.0.5/requirements.txt +17 -0
  44. lyrpy-2025.0.5/setup.cfg +20 -0
  45. {lyrpy-1.0.0 → lyrpy-2025.0.5}/setup.py +30 -1
  46. lyrpy-2025.0.5/tests/test_lyrpy.py +4 -0
  47. lyrpy-1.0.0/PKG-INFO +0 -24
  48. lyrpy-1.0.0/README.md +0 -1
  49. lyrpy-1.0.0/SRC/__init__.py +0 -0
  50. lyrpy-1.0.0/TESTS/__init__.py +0 -0
  51. lyrpy-1.0.0/lyrpy.egg-info/PKG-INFO +0 -24
  52. lyrpy-1.0.0/lyrpy.egg-info/SOURCES.txt +0 -46
  53. lyrpy-1.0.0/lyrpy.egg-info/top_level.txt +0 -2
  54. lyrpy-1.0.0/pyproject.toml +0 -13
  55. lyrpy-1.0.0/setup.cfg +0 -4
  56. {lyrpy-1.0.0 → lyrpy-2025.0.5}/LICENSE +0 -0
  57. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUParserREG.py +0 -0
  58. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUQThread.py +0 -0
  59. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUQTimer.py +0 -0
  60. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUSheduler.py +0 -0
  61. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUStrDecode.py +0 -0
  62. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUSupport.py +0 -0
  63. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUThread.py +0 -0
  64. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUTimer.py +0 -0
  65. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUYouTube.py +0 -0
  66. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5}/lyrpy/LUsys.py +0 -0
  67. /lyrpy-1.0.0/SRC/LIB/lyrpy/__main__.py → /lyrpy-2025.0.5/lyrpy/main.py +0 -0
  68. {lyrpy-1.0.0 → lyrpy-2025.0.5}/lyrpy.egg-info/dependency_links.txt +0 -0
  69. {lyrpy-1.0.0/SRC/LIB → lyrpy-2025.0.5/tests}/__init__.py +0 -0
  70. {lyrpy-1.0.0/TESTS → lyrpy-2025.0.5/tests}/test_main.py +0 -0
@@ -0,0 +1,12 @@
1
+ include *.txt
2
+ include *.md
3
+ include LICENSE
4
+
5
+ include lyrpy/logging*.*
6
+ recursive-include lyrpy/data *
7
+ recursive-include lyrpy/templates *
8
+ recursive-include lyrpy/static *
9
+ recursive-include docs *
10
+ # recursive-include tests *
11
+
12
+ include config/*.cfg
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: lyrpy
3
+ Version: 2025.0.5
4
+ Summary: lyrpy
5
+ Home-page: https://github.com/lisitsinyr/TOOLS_SRC_PY
6
+ Author: lisitsinyr
7
+ Author-email: lisitsinyr <lisitsinyr@gmail.com>
8
+ Maintainer-email: "A. Great Maintainer" <maintainer@example.com>
9
+ License-Expression: MIT
10
+ Project-URL: Issues, https://github.com/pypa/sampleproject/issues
11
+ Project-URL: Homepage, https://github.com/pypa/sampleproject
12
+ Project-URL: Bug Reports, https://github.com/pypa/sampleproject/issues
13
+ Project-URL: Funding, https://donate.pypi.org
14
+ Project-URL: Say Thanks!, http://saythanks.io/to/example
15
+ Project-URL: Source, https://github.com/pypa/sampleproject/
16
+ Keywords: sample,setuptools,development
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Operating System :: OS Independent
19
+ Requires-Python: >=3.6
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: pip>=25.3
23
+ Provides-Extra: dev
24
+ Requires-Dist: check-manifest; extra == "dev"
25
+ Dynamic: author
26
+ Dynamic: home-page
27
+ Dynamic: license-file
28
+ Dynamic: requires-python
29
+
30
+ # TOOLS_SRC_PY - lyrpy
@@ -0,0 +1 @@
1
+ # TOOLS_SRC_PY - lyrpy
@@ -0,0 +1 @@
1
+ settings.cfg
@@ -0,0 +1 @@
1
+ # docs -
@@ -2,7 +2,7 @@
2
2
  # -*- coding: UTF-8 -*-
3
3
  __annotations__ = """
4
4
  =======================================================
5
- Copyright (c) 2023-2024
5
+ Copyright (c) 2023-2025
6
6
  Author:
7
7
  Lisitsin Y.R.
8
8
  Project:
@@ -2,7 +2,7 @@
2
2
  # -*- coding: UTF-8 -*-
3
3
  __annotations__ = """
4
4
  =======================================================
5
- Copyright (c) 2023-2024
5
+ Copyright (c) 2023-2025
6
6
  Author:
7
7
  Lisitsin Y.R.
8
8
  Project:
@@ -2,7 +2,7 @@
2
2
  # -*- coding: UTF-8 -*-
3
3
  __annotations__ = """
4
4
  =======================================================
5
- Copyright (c) 2023-2024
5
+ Copyright (c) 2023-2025
6
6
  Author:
7
7
  Lisitsin Y.R.
8
8
  Project:
@@ -2,7 +2,7 @@
2
2
  # -*- coding: UTF-8 -*-
3
3
  __annotations__ = """
4
4
  =======================================================
5
- Copyright (c) 2023-2024
5
+ Copyright (c) 2023-2025
6
6
  Author:
7
7
  Lisitsin Y.R.
8
8
  Project:
@@ -2,7 +2,7 @@
2
2
  # -*- coding: UTF-8 -*-
3
3
  __annotations__ = """
4
4
  =======================================================
5
- Copyright (c) 2023-2024
5
+ Copyright (c) 2023-2025
6
6
  Author:
7
7
  Lisitsin Y.R.
8
8
  Project:
@@ -17,7 +17,6 @@ __annotations__ = """
17
17
  #------------------------------------------
18
18
  # БИБЛИОТЕКИ python
19
19
  #------------------------------------------
20
- #import sys
21
20
 
22
21
  #------------------------------------------
23
22
  # БИБЛИОТЕКИ сторонние
@@ -26,7 +25,6 @@ __annotations__ = """
26
25
  #------------------------------------------
27
26
  # БИБЛИОТЕКИ LU
28
27
  #------------------------------------------
29
- import lyrpy.LULog as LULog
30
28
 
31
29
  #---------------------------------------------------------------
32
30
  # PrintInfoObject
@@ -2,7 +2,7 @@
2
2
  # -*- coding: UTF-8 -*-
3
3
  __annotations__ = """
4
4
  =======================================================
5
- Copyright (c) 2023-2024
5
+ Copyright (c) 2023-2025
6
6
  Author:
7
7
  Lisitsin Y.R.
8
8
  Project:
@@ -19,14 +19,12 @@ import errno
19
19
  # БИБЛИОТЕКИ python
20
20
  #------------------------------------------
21
21
  import os
22
- import platform
23
22
  import stat
24
23
  import datetime
25
24
  import logging
26
25
  import tempfile
27
26
  import re
28
27
  import ctypes
29
- import copy
30
28
  import pathlib
31
29
 
32
30
  # if platform.system() == 'Windows':
@@ -47,12 +45,10 @@ import chardet
47
45
  #------------------------------------------
48
46
  # БИБЛИОТЕКА LU
49
47
  #------------------------------------------
50
- import lyrpy.LUErrors as LUErrors
51
48
  import lyrpy.LUStrDecode as LUStrDecode
52
49
  import lyrpy.LUDateTime as LUDateTime
53
50
  import lyrpy.LUos as LUos
54
51
  import lyrpy.LULog as LULog
55
- # import lyrpy.LUFile as LUFile
56
52
 
57
53
  """
58
54
  #--------------------------------------------------------------------------------
@@ -1058,7 +1054,7 @@ def WriteStrToFile (AFileName: str, AStr: str, AEncoding: str = ''):
1058
1054
  #beginfunction
1059
1055
  s = f'WriteStrToFile: {AFileName:s} ...'
1060
1056
  # LULog.LoggerTOOLS_AddLevel (logging.DEBUG, s)
1061
- LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
1057
+ # LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
1062
1058
 
1063
1059
  # Откроет для добавления нового содержимого.
1064
1060
  # Создаст новый файл для чтения записи, если не найдет с указанным именем.
@@ -1209,6 +1205,42 @@ def GetPureWindowsPath (APath: str) -> str:
1209
1205
  return LResult
1210
1206
  #endfunction
1211
1207
 
1208
+ def sanitize_filename (filename, replacement = '_', platform = None):
1209
+ """
1210
+ Очищает строку, оставляя только допустимые символы для имени файла.
1211
+
1212
+ :param filename: исходное имя файла
1213
+ :param replacement: символ для замены недопустимых символов
1214
+ :param platform: целевая платформа ('windows', 'linux', 'darwin' и т.д.), по умолчанию используется текущая ОС
1215
+ :return: корректное имя файла
1216
+ """
1217
+ if not platform:
1218
+ platform = os.name
1219
+
1220
+ # Обрезаем до разумной длины (обычно максимум 255 байт)
1221
+ max_length = 255
1222
+
1223
+ # Удаление начальных и конечные пробелы
1224
+ filename = filename.strip ()
1225
+
1226
+ # Замена недопустимых символов
1227
+ if platform == 'nt': # Windows
1228
+ invalid_chars = r'[<>:"/\\|?*\x00-\x1F]'
1229
+ else: # Linux/macOS
1230
+ invalid_chars = r'[/\x00]'
1231
+
1232
+ filename = re.sub (invalid_chars, replacement, filename)
1233
+
1234
+ # Удаление лишних точек и подряд идущих заменителей
1235
+ filename = re.sub (r'(\.' + re.escape (replacement) + r')+', '.', filename)
1236
+ filename = re.sub (re.escape (replacement) + r'{2,}', replacement, filename)
1237
+
1238
+ # Если имя стало пустым — вернуть дефолт
1239
+ if not filename:
1240
+ filename = f"unnamed_file{replacement}"
1241
+
1242
+ return filename [:max_length]
1243
+
1212
1244
  #-------------------------------------------------------------------------------
1213
1245
  # main
1214
1246
  #-------------------------------------------------------------------------------
@@ -2,7 +2,7 @@
2
2
  # -*- coding: UTF-8 -*-
3
3
  __annotations__ = """
4
4
  =======================================================
5
- Copyright (c) 2023-2024
5
+ Copyright (c) 2023-2025
6
6
  Author:
7
7
  Lisitsin Y.R.
8
8
  Project:
@@ -18,29 +18,17 @@ __annotations__ = """
18
18
  # БИБЛИОТЕКИ python
19
19
  #------------------------------------------
20
20
  import os
21
- import stat
22
21
  import sys
23
- import time
24
- import chardet
25
22
  import logging
26
23
 
27
24
  #------------------------------------------
28
25
  # БИБЛИОТЕКИ сторонние
29
26
  #------------------------------------------
30
- import datetime
31
- import shutil
32
- import platform
33
- # if platform.system() == 'Windows':
34
- # import win32api
35
- # import win32con
36
- # #endif
37
27
 
38
28
  #------------------------------------------
39
29
  # БИБЛИОТЕКА LU
40
30
  #------------------------------------------
41
- import lyrpy.LUErrors as LUErrors
42
31
  import lyrpy.LUFile as LUFile
43
- import lyrpy.LUStrDecode as LUStrDecode
44
32
  import lyrpy.LULog as LULog
45
33
  import lyrpy.LUDateTime as LUDateTime
46
34