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.

Files changed (149) hide show
  1. SRC/LIB/__init__.py +21 -0
  2. SRC/LIB/lyrpy/LUConst.py +358 -0
  3. {lyrpy → SRC/LIB/lyrpy}/LUDateTime.py +2 -4
  4. {lyrpy → SRC/LIB/lyrpy}/LUDecotators.py +2 -3
  5. {lyrpy → SRC/LIB/lyrpy}/LUDict.py +0 -1
  6. {lyrpy → SRC/LIB/lyrpy}/LUDoc.py +4 -3
  7. {lyrpy → SRC/LIB/lyrpy}/LUErrors.py +0 -1
  8. {lyrpy → SRC/LIB/lyrpy}/LUFile.py +115 -61
  9. {lyrpy → SRC/LIB/lyrpy}/LUFileUtils.py +60 -45
  10. {lyrpy → SRC/LIB/lyrpy}/LULog.py +267 -191
  11. {lyrpy → SRC/LIB/lyrpy}/LUObjects.py +4 -4
  12. {lyrpy → SRC/LIB/lyrpy}/LUObjectsYT.py +39 -22
  13. {lyrpy → SRC/LIB/lyrpy}/LUParserARG.py +2 -3
  14. {lyrpy → SRC/LIB/lyrpy}/LUParserINI.py +8 -3
  15. {lyrpy → SRC/LIB/lyrpy}/LUParserREG.py +5 -1
  16. {lyrpy → SRC/LIB/lyrpy}/LUQThread.py +6 -4
  17. {lyrpy → SRC/LIB/lyrpy}/LUQTimer.py +5 -5
  18. {lyrpy → SRC/LIB/lyrpy}/LUSheduler.py +24 -23
  19. SRC/LIB/lyrpy/LUTelegram.py +428 -0
  20. {lyrpy → SRC/LIB/lyrpy}/LUThread.py +7 -6
  21. {lyrpy → SRC/LIB/lyrpy}/LUTimer.py +5 -3
  22. {lyrpy → SRC/LIB/lyrpy}/LUVersion.py +4 -1
  23. {lyrpy → SRC/LIB/lyrpy}/LUYouTube.py +6 -7
  24. {lyrpy → SRC/LIB/lyrpy}/LUos.py +13 -3
  25. SRC/LIB/lyrpy/__init__.py +21 -0
  26. {lyrpy → SRC/LIB/lyrpy}/__main__.py +20 -19
  27. SRC/__init__.py +0 -0
  28. SRC/lyrpy/LUConsole.py +402 -0
  29. SRC/lyrpy/LUConst.py +358 -0
  30. SRC/lyrpy/LUDateTime.py +205 -0
  31. SRC/lyrpy/LUDecotators.py +417 -0
  32. SRC/lyrpy/LUDict.py +116 -0
  33. SRC/lyrpy/LUDoc.py +62 -0
  34. SRC/lyrpy/LUErrors.py +79 -0
  35. SRC/lyrpy/LUFile.py +1228 -0
  36. SRC/lyrpy/LUFileUtils.py +501 -0
  37. SRC/lyrpy/LULog.py +2324 -0
  38. SRC/lyrpy/LUNetwork.py +277 -0
  39. SRC/lyrpy/LUNumUtils.py +305 -0
  40. SRC/lyrpy/LUObjects.py +208 -0
  41. SRC/lyrpy/LUObjectsYT.py +846 -0
  42. SRC/lyrpy/LUParserARG.py +364 -0
  43. SRC/lyrpy/LUParserINI.py +376 -0
  44. SRC/lyrpy/LUParserREG.py +514 -0
  45. SRC/lyrpy/LUProc.py +110 -0
  46. SRC/lyrpy/LUQThread.py +141 -0
  47. SRC/lyrpy/LUQTimer.py +197 -0
  48. SRC/lyrpy/LUSheduler.py +941 -0
  49. SRC/lyrpy/LUStrDecode.py +223 -0
  50. SRC/lyrpy/LUStrUtils.py +633 -0
  51. SRC/lyrpy/LUSupport.py +124 -0
  52. SRC/lyrpy/LUTelegram.py +428 -0
  53. SRC/lyrpy/LUThread.py +177 -0
  54. SRC/lyrpy/LUTimer.py +141 -0
  55. SRC/lyrpy/LUVersion.py +383 -0
  56. SRC/lyrpy/LUYouTube.py +203 -0
  57. SRC/lyrpy/LUos.py +807 -0
  58. lyrpy/LUConst.py → SRC/lyrpy/LUsys.py +12 -10
  59. SRC/lyrpy/__init__.py +21 -0
  60. lyrpy/__init__.py → SRC/lyrpy/__main__.py +2 -3
  61. TESTS/__init__.py +0 -0
  62. TESTS/test_lyrpy.py +4 -0
  63. TESTS/test_main.py +10 -0
  64. __SRC/LIB/__init__.py +0 -0
  65. __SRC/LIB/lyrpy/LUConsole.py +402 -0
  66. __SRC/LIB/lyrpy/LUConst.py +358 -0
  67. __SRC/LIB/lyrpy/LUDateTime.py +205 -0
  68. __SRC/LIB/lyrpy/LUDecotators.py +417 -0
  69. __SRC/LIB/lyrpy/LUDict.py +116 -0
  70. __SRC/LIB/lyrpy/LUDoc.py +62 -0
  71. __SRC/LIB/lyrpy/LUErrors.py +79 -0
  72. __SRC/LIB/lyrpy/LUFile.py +1228 -0
  73. __SRC/LIB/lyrpy/LUFileUtils.py +501 -0
  74. __SRC/LIB/lyrpy/LULog.py +2324 -0
  75. __SRC/LIB/lyrpy/LUNetwork.py +277 -0
  76. __SRC/LIB/lyrpy/LUNumUtils.py +305 -0
  77. __SRC/LIB/lyrpy/LUObjects.py +208 -0
  78. __SRC/LIB/lyrpy/LUObjectsYT.py +846 -0
  79. __SRC/LIB/lyrpy/LUParserARG.py +364 -0
  80. __SRC/LIB/lyrpy/LUParserINI.py +376 -0
  81. __SRC/LIB/lyrpy/LUParserREG.py +514 -0
  82. __SRC/LIB/lyrpy/LUProc.py +110 -0
  83. __SRC/LIB/lyrpy/LUQThread.py +141 -0
  84. __SRC/LIB/lyrpy/LUQTimer.py +197 -0
  85. __SRC/LIB/lyrpy/LUSheduler.py +941 -0
  86. __SRC/LIB/lyrpy/LUStrDecode.py +223 -0
  87. __SRC/LIB/lyrpy/LUStrUtils.py +633 -0
  88. __SRC/LIB/lyrpy/LUSupport.py +124 -0
  89. __SRC/LIB/lyrpy/LUTelegram.py +428 -0
  90. __SRC/LIB/lyrpy/LUThread.py +177 -0
  91. __SRC/LIB/lyrpy/LUTimer.py +141 -0
  92. __SRC/LIB/lyrpy/LUVersion.py +383 -0
  93. __SRC/LIB/lyrpy/LUYouTube.py +203 -0
  94. __SRC/LIB/lyrpy/LUos.py +807 -0
  95. __SRC/LIB/lyrpy/LUsys.py +47 -0
  96. __SRC/LIB/lyrpy/__init__.py +21 -0
  97. __SRC/LIB/lyrpy/__main__.py +20 -0
  98. __SRC/__init__.py +0 -0
  99. ____src/__init__.py +0 -0
  100. ____src/lyrpy/LUConsole.py +402 -0
  101. ____src/lyrpy/LUConst.py +358 -0
  102. ____src/lyrpy/LUDateTime.py +205 -0
  103. ____src/lyrpy/LUDecotators.py +417 -0
  104. ____src/lyrpy/LUDict.py +116 -0
  105. ____src/lyrpy/LUDoc.py +62 -0
  106. ____src/lyrpy/LUErrors.py +79 -0
  107. ____src/lyrpy/LUFile.py +1228 -0
  108. ____src/lyrpy/LUFileUtils.py +501 -0
  109. ____src/lyrpy/LULog.py +2324 -0
  110. ____src/lyrpy/LUNetwork.py +277 -0
  111. ____src/lyrpy/LUNumUtils.py +305 -0
  112. ____src/lyrpy/LUObjects.py +208 -0
  113. ____src/lyrpy/LUObjectsYT.py +846 -0
  114. ____src/lyrpy/LUParserARG.py +364 -0
  115. ____src/lyrpy/LUParserINI.py +376 -0
  116. ____src/lyrpy/LUParserREG.py +514 -0
  117. ____src/lyrpy/LUProc.py +110 -0
  118. ____src/lyrpy/LUQThread.py +141 -0
  119. ____src/lyrpy/LUQTimer.py +197 -0
  120. ____src/lyrpy/LUSheduler.py +941 -0
  121. ____src/lyrpy/LUStrDecode.py +223 -0
  122. ____src/lyrpy/LUStrUtils.py +633 -0
  123. ____src/lyrpy/LUSupport.py +124 -0
  124. ____src/lyrpy/LUTelegram.py +428 -0
  125. ____src/lyrpy/LUThread.py +177 -0
  126. ____src/lyrpy/LUTimer.py +141 -0
  127. ____src/lyrpy/LUVersion.py +383 -0
  128. ____src/lyrpy/LUYouTube.py +203 -0
  129. ____src/lyrpy/LUos.py +807 -0
  130. ____src/lyrpy/LUsys.py +47 -0
  131. ____src/lyrpy/__init__.py +21 -0
  132. ____src/lyrpy/__main__.py +20 -0
  133. lyrpy-2025.0.2.dist-info/METADATA +21 -0
  134. lyrpy-2025.0.2.dist-info/RECORD +145 -0
  135. {lyrpy-2024.0.4.dist-info → lyrpy-2025.0.2.dist-info}/WHEEL +1 -1
  136. lyrpy-2025.0.2.dist-info/top_level.txt +2 -0
  137. lyrpy-2024.0.4.data/data/data/text.txt +0 -1
  138. lyrpy-2024.0.4.dist-info/METADATA +0 -44
  139. lyrpy-2024.0.4.dist-info/RECORD +0 -38
  140. lyrpy-2024.0.4.dist-info/top_level.txt +0 -1
  141. {lyrpy → SRC/LIB/lyrpy}/LUConsole.py +0 -0
  142. {lyrpy → SRC/LIB/lyrpy}/LUNetwork.py +0 -0
  143. {lyrpy → SRC/LIB/lyrpy}/LUNumUtils.py +0 -0
  144. {lyrpy → SRC/LIB/lyrpy}/LUProc.py +0 -0
  145. {lyrpy → SRC/LIB/lyrpy}/LUStrDecode.py +0 -0
  146. {lyrpy → SRC/LIB/lyrpy}/LUStrUtils.py +0 -0
  147. {lyrpy → SRC/LIB/lyrpy}/LUSupport.py +0 -0
  148. {lyrpy → SRC/LIB/lyrpy}/LUsys.py +0 -0
  149. {lyrpy-2024.0.4.dist-info → lyrpy-2025.0.2.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,177 @@
1
+ """LUThread.py"""
2
+ # -*- coding: UTF-8 -*-
3
+ __annotations__ = """
4
+ =======================================================
5
+ Copyright (c) 2023-2024
6
+ Author:
7
+ Lisitsin Y.R.
8
+ Project:
9
+ LU_PY
10
+ Python (LU)
11
+ Module:
12
+ LUThread.py
13
+
14
+ =======================================================
15
+ """
16
+
17
+ #------------------------------------------
18
+ # БИБЛИОТЕКИ python
19
+ #------------------------------------------
20
+ import threading
21
+ import logging
22
+
23
+ #------------------------------------------
24
+ # БИБЛИОТЕКИ сторонние
25
+ #------------------------------------------
26
+
27
+ #------------------------------------------
28
+ # БИБЛИОТЕКА LU
29
+ #------------------------------------------
30
+ import lyrpy.LULog as LULog
31
+
32
+ # class ScheduleThread (threading.Thread):
33
+ # @classmethod
34
+ # def run (cls):
35
+ # while not cease_continuous_run.is_set ():
36
+ # schedule.run_pending ()
37
+ # time.sleep (interval)
38
+
39
+ # threading.Thread.name
40
+ #threading.active_count() количество живых потоков,
41
+ #threading.current_thread() текущий поток,
42
+ #threading.excepthook() обрабатывает неперехваченные исключения в потоках,
43
+ #threading.get_ident() идентификатор текущего потока,
44
+ #threading.get_native_id() интегральный идентификатор текущего потока,
45
+ #threading.enumerate() список объектов всех живых потоков,
46
+ #threading.main_thread() объект основной потока,
47
+ #threading.TIMEOUT_MAX максимально значение для тайм-аута блокировки.
48
+
49
+ #threading.active_count():
50
+ #Функция threading.active_count() возвращает количество живых потоков - объектов threading.Thread().
51
+ #Возвращенное количество равно длине списка, возвращаемого функцией threading.enumerate().
52
+
53
+ #threading.get_ident():
54
+ #Функция threading.get_ident() возвращает идентификатор текущего потока. Это ненулевое целое число.
55
+
56
+ #threading.enumerate():
57
+ #Функция threading.enumerate() возвращает список объектов threading.Thread() всех живых потоков.
58
+
59
+ class TThread (threading.Thread):
60
+ """TThread"""
61
+ luClassName = 'TThread'
62
+
63
+ #--------------------------------------------------
64
+ # constructor
65
+ #--------------------------------------------------
66
+ def __init__ (self, *args, **kwargs):
67
+ # def __init__ (self, group = None, target = None,
68
+ # name = None, args = (),
69
+ # kwargs = {}, *, daemon = None):
70
+
71
+ """Constructor"""
72
+ #beginfunction
73
+ super ().__init__ (*args, **kwargs)
74
+ # super ().__init__ (group = group, target = target,
75
+ # name = name,
76
+ # *args,
77
+ # **kwargs,
78
+ # daemon = daemon)
79
+ #
80
+ self.args = args
81
+ self.kwargs = kwargs
82
+ # print ('args=',args)
83
+ # print ('kwargs=',kwargs)
84
+ self.__FStopThread = False
85
+ #endfunction
86
+
87
+ #--------------------------------------------------
88
+ # destructor
89
+ #--------------------------------------------------
90
+ def __del__ (self):
91
+ """destructor"""
92
+ #beginfunction
93
+ LClassName = self.__class__.__name__
94
+ # s = '{} уничтожен'.format (LClassName)
95
+ # LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
96
+ #print (s)
97
+ #endfunction
98
+
99
+ #--------------------------------------------------
100
+ # @property Thread
101
+ #--------------------------------------------------
102
+ # getter
103
+ @property
104
+ def Thread(self) -> threading.Thread:
105
+ #beginfunction
106
+ return self
107
+ #endfunction
108
+
109
+ # #--------------------------------------------------
110
+ # # start
111
+ # #--------------------------------------------------
112
+ # def start(self):
113
+ # """start - Запуск потока"""
114
+ # #beginfunction
115
+ # s = 'start - Запуск потока...'
116
+ # LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
117
+ # # self.Function ()
118
+ # super ().start ()
119
+ # #endfunction
120
+
121
+ #--------------------------------------------------
122
+ # run
123
+ #--------------------------------------------------
124
+ def run(self):
125
+ """run - Запуск потока"""
126
+ #beginfunction
127
+ s = 'run - Запуск потока...'
128
+ LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
129
+ super ().run()
130
+ while not self.__FStopThread:
131
+ # s = 'Выполнение потока...'
132
+ # LULog.LoggerTOOLS_AddDebug (s)
133
+ continue
134
+ #endwhile
135
+ #endfunction
136
+
137
+ #--------------------------------------------------
138
+ # StartThread
139
+ #--------------------------------------------------
140
+ def StartThread(self):
141
+ """StartThread"""
142
+ #beginfunction
143
+ s = 'StartThread...'
144
+ LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
145
+ self.__FStopThread = False
146
+ self.run()
147
+ #endfunction
148
+ #--------------------------------------------------
149
+ # StopThread
150
+ #--------------------------------------------------
151
+ def StopThread(self):
152
+ """StopThread"""
153
+ #beginfunction
154
+ s = 'StopThread...'
155
+ LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
156
+ self.__FStopThread = True
157
+ #endfunction
158
+
159
+ #endclass
160
+
161
+ #---------------------------------------------------------
162
+ # main
163
+ #---------------------------------------------------------
164
+ def main ():
165
+ #beginfunction
166
+ ...
167
+ #endfunction
168
+
169
+ #---------------------------------------------------------
170
+ #
171
+ #---------------------------------------------------------
172
+ #beginmodule
173
+ if __name__ == "__main__":
174
+ main()
175
+ #endif
176
+
177
+ #endmodule
@@ -0,0 +1,141 @@
1
+ """LUThread.py"""
2
+ # -*- coding: UTF-8 -*-
3
+ __annotations__ = """
4
+ =======================================================
5
+ Copyright (c) 2023-2024
6
+ Author:
7
+ Lisitsin Y.R.
8
+ Project:
9
+ LU_PY
10
+ Python (LU)
11
+ Module:
12
+ LUTimer.py
13
+
14
+ =======================================================
15
+ """
16
+
17
+ #------------------------------------------
18
+ # БИБЛИОТЕКИ python
19
+ #------------------------------------------
20
+ import threading
21
+ import logging
22
+
23
+ #------------------------------------------
24
+ # БИБЛИОТЕКИ сторонние
25
+ #------------------------------------------
26
+
27
+ #------------------------------------------
28
+ # БИБЛИОТЕКА LU
29
+ #------------------------------------------
30
+ import lyrpy.LULog as LULog
31
+
32
+ # Create the Worker Thread
33
+ class TTimer (threading.Timer):
34
+ """TQTimer"""
35
+ luClassName = 'TTimer'
36
+
37
+ #--------------------------------------------------
38
+ # constructor
39
+ #--------------------------------------------------
40
+ # def __init__ (self, AFuction, parent = None):
41
+ def __init__ (self, AInterval, AFunction, *args, **kwargs):
42
+ #beginfunction
43
+ super ().__init__ (AInterval, AFunction, *args, **kwargs)
44
+ self.args = args
45
+ self.kwargs = kwargs
46
+
47
+ self.__FFunction = AFunction
48
+
49
+ # # Instantiate signals and connect signals to the slots
50
+ # self.signals = MySignals ()
51
+ # self.signals.signal_str.connect (parent.update_str_field)
52
+ # self.signals.signal_int.connect (parent.update_int_field)
53
+
54
+ self.__FStopTimer = False
55
+
56
+ #endfunction
57
+
58
+ #--------------------------------------------------
59
+ # destructor
60
+ #--------------------------------------------------
61
+ def __del__ (self):
62
+ """destructor"""
63
+ #beginfunction
64
+ LClassName = self.__class__.__name__
65
+ # s = '{} уничтожен'.format (LClassName)
66
+ # LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
67
+ #print (s)
68
+ #endfunction
69
+
70
+ #--------------------------------------------------
71
+ # @property TQTimer
72
+ #--------------------------------------------------
73
+ # getter
74
+ @property
75
+ def Timer(self):
76
+ #beginfunction
77
+ return self
78
+ #endfunction
79
+
80
+ # #--------------------------------------------------
81
+ # # start
82
+ # #--------------------------------------------------
83
+ # def start(self):
84
+ # """start - Запуск таймера"""
85
+ # #beginfunction
86
+ # s = 'Запуск таймера...'
87
+ # LULog.LoggerTOOLS_AddLevel (LULog.DEBUGTEXT, s)
88
+ # # self.Function ()
89
+ # super ().start ()
90
+ # #endfunction
91
+
92
+ #--------------------------------------------------
93
+ # run
94
+ #--------------------------------------------------
95
+ def run(self):
96
+ """run - Запуск таймера"""
97
+ #beginfunction
98
+ s = 'run - Запуск таймера...'
99
+ LULog.LoggerAdd (LULog.LoggerTOOLS, logging.DEBUG, s)
100
+ # super ().run()
101
+
102
+ # self.Function()
103
+
104
+ while not self.__FStopTimer:
105
+ # s = 'Выполнение таймера...'
106
+ # LULog.LoggerTOOLS_AddDebug (s)
107
+ continue
108
+ #endwhile
109
+
110
+ # # Do something on the worker thread
111
+ # a = 1 + 1
112
+ # # Emit signals whenever you want
113
+ # self.signals.signal_int.emit (a)
114
+ # self.signals.signal_str.emit ("This text comes to Main thread from our Worker thread.")
115
+
116
+ # while 1:
117
+ # Lval = psutil.cpu_percent ()
118
+ # # self.emit(QtCore.SIGNAL('CPU_VALUE'), Lval)
119
+ # ...
120
+ # #endwhile
121
+
122
+ #endfunction
123
+ #endclass
124
+
125
+ #---------------------------------------------------------
126
+ # main
127
+ #---------------------------------------------------------
128
+ def main ():
129
+ #beginfunction
130
+ ...
131
+ #endfunction
132
+
133
+ #---------------------------------------------------------
134
+ #
135
+ #---------------------------------------------------------
136
+ #beginmodule
137
+ if __name__ == "__main__":
138
+ main()
139
+ #endif
140
+
141
+ #endmodule
@@ -0,0 +1,383 @@
1
+ """LUVersion.py"""
2
+ # -*- coding: UTF-8 -*-
3
+ __annotations__ = """
4
+ =======================================================
5
+ Copyright (c) 2023-2024
6
+ Author:
7
+ Lisitsin Y.R.
8
+ Project:
9
+ LU_PY
10
+ Python (LU)
11
+ Module:
12
+ LUVersion.py
13
+
14
+ =======================================================
15
+ """
16
+ #------------------------------------------
17
+ # БИБЛИОТЕКИ python
18
+ #------------------------------------------
19
+ import os
20
+ import platform
21
+
22
+ #------------------------------------------
23
+ # БИБЛИОТЕКИ сторонние
24
+ #------------------------------------------
25
+ import datetime
26
+
27
+ import win32api
28
+
29
+
30
+ # if platform.system() == 'Windows':
31
+ # import win32api
32
+ # import win32con
33
+ # #endif
34
+
35
+ #------------------------------------------
36
+ # БИБЛИОТЕКА LU
37
+ #------------------------------------------
38
+
39
+ class TVersionInfo:
40
+ """TVersionInfo"""
41
+ luClassName = "TVersionInfo"
42
+
43
+ #--------------------------------------------------
44
+ # constructor
45
+ #--------------------------------------------------
46
+ def __init__(self):
47
+ self.__FFileName = ''
48
+ self.__FInfo = None
49
+ self.__FFileDate = 0
50
+ self.__FFileVersion = ''
51
+ self.__FFileInfoSize = 0
52
+ self.__FInfoSize = 0
53
+ self.__FFileInfo = None
54
+ self.__FCompanyName = ''
55
+ self.__FFileDescription = ''
56
+ self.__FInternalName = ''
57
+ self.__FLegalTrademarks = ''
58
+ self.__FLegalCopyright = ''
59
+ self.__FProductName = ''
60
+ self.__FOriginalFilename = ''
61
+ self.__FProductVersion = ''
62
+ self.__FComments = ''
63
+
64
+ self.__lang = ''
65
+ self.__codepage = ''
66
+
67
+ self.__FTmp = None
68
+ self.__FTransInfo = None
69
+ self.__FTransInfoSize = 0
70
+
71
+ #--------------------------------------------------
72
+ # destructor
73
+ #--------------------------------------------------
74
+ def __del__(self):
75
+ #beginfunction
76
+ LClassName = self.__class__.__name__
77
+ # s = '{} уничтожен'.format (LClassName)
78
+ #print (s)
79
+ #endfunction
80
+
81
+ #--------------------------------------------------
82
+ # @property FileName
83
+ #--------------------------------------------------
84
+ # getter
85
+ @property
86
+ def FileName(self):
87
+ #beginfunction
88
+ return self.__FFileName
89
+ #endfunction
90
+ # setter
91
+ @FileName.setter
92
+ def FileName(self, Value: str):
93
+ propNames = ('Comments', 'InternalName', 'ProductName',
94
+ 'CompanyName', 'LegalCopyright', 'ProductVersion',
95
+ 'FileDescription', 'LegalTrademarks', 'PrivateBuild',
96
+ 'FileVersion', 'OriginalFilename', 'SpecialBuild')
97
+
98
+ props = {'FixedFileInfo': None, 'StringFileInfo': None, 'FileVersion': None}
99
+ #beginfunction
100
+ if Value == '':
101
+ return
102
+ self.__FFileName = Value
103
+ # Get the size of the FileVersionInformatioin
104
+ if self.__FInfoSize > 0:
105
+ pass
106
+ #self.__FInfoSize = win32api.GetFileVersionInfoSize(self.__FFileName.encode(), None)
107
+ # If InfoSize = 0, then the file may not exist, or
108
+ # it may not have file version information in it.
109
+ #if self.__FInfoSize == 0:
110
+ # raise Exception.Create("Can''t get file version information for "+self.__FFileName)
111
+
112
+ #file modification
113
+ #self.__FFileDate = FileDateToDateTime(FileAge(Value))
114
+ LFileTimeSource = os.path.getmtime(self.__FFileName)
115
+ #convert timestamp into DateTime object
116
+ self.__FFileDate = datetime.datetime.fromtimestamp(LFileTimeSource)
117
+
118
+ # Get the information
119
+ #self.__FInfo = win32api.GetFileVersionInfo(self.__FFileName, 0, self.__FInfoSize, self.__FInfo)
120
+ # backslash as parm returns dictionary of numeric info corresponding to VS_FIXEDFILEINFO struc
121
+ self.__FInfo = win32api.GetFileVersionInfo (self.__FFileName, '\\')
122
+ props ['FixedFileInfo'] = self.__FInfo
123
+ props ['FileVersion'] = "%d.%d.%d.%d" % (self.__FInfo ['FileVersionMS'] / 65536,
124
+ self.__FInfo ['FileVersionMS'] % 65536,
125
+ self.__FInfo ['FileVersionLS'] / 65536,
126
+ self.__FInfo ['FileVersionLS'] % 65536)
127
+ self.__FFileVersion = props ['FileVersion']
128
+
129
+ # \VarFileInfo\Translation returns list of available (language, codepage)
130
+ # pairs that can be used to retreive string info. We are using only the first pair.
131
+ self.__lang, self.__codepage = win32api.GetFileVersionInfo (self.__FFileName, '\\VarFileInfo\\Translation') [0]
132
+ #print ('__lang = ',self.__lang)
133
+ #print ('__codepage = ', self.__codepage)
134
+
135
+ # any other must be of the form \StringfileInfo\%04X%04X\parm_name, middle
136
+ # two are language/codepage pair returned from above
137
+ strInfo = {}
138
+ for propName in propNames:
139
+ strInfoPath = u'\\StringFileInfo\\%04X%04X\\%s' % (self.__lang, self.__codepage, propName)
140
+ #print str_info
141
+ strInfo [propName] = win32api.GetFileVersionInfo (self.__FFileName, strInfoPath)
142
+ props ['StringFileInfo'] = strInfo
143
+ self.__FCompanyName = strInfo ['CompanyName']
144
+ self.__FFileDescription = strInfo ['FileDescription']
145
+ self.__FInternalName = strInfo ['InternalName']
146
+ self.__FLegalCopyright = strInfo ['LegalCopyright']
147
+ self.__FLegalTrademarks = strInfo ['LegalTrademarks']
148
+ self.__FOriginalFilename = strInfo ['OriginalFilename']
149
+ self.__FProductName = strInfo ['ProductName']
150
+ self.__FProductVersion = strInfo ['ProductVersion']
151
+ self.__FComments = strInfo ['Comments']
152
+ #endfunction
153
+
154
+ #--------------------------------------------------
155
+ # @property Major1
156
+ #--------------------------------------------------
157
+ # getter
158
+ @property
159
+ def Major1(self):
160
+ #beginfunction
161
+ LResult = int(self.__FInfo ['FileVersionMS'] / 65536)
162
+ return LResult
163
+ #endfunction
164
+
165
+ #--------------------------------------------------
166
+ # @property Major2
167
+ #--------------------------------------------------
168
+ # getter
169
+ @property
170
+ def Major2(self):
171
+ #beginfunction
172
+ LResult = int(self.__FInfo ['FileVersionMS'] % 65536)
173
+ return LResult
174
+ #endfunction
175
+
176
+ #--------------------------------------------------
177
+ # @property Minor1
178
+ #--------------------------------------------------
179
+ # getter
180
+ @property
181
+ def Minor1(self):
182
+ #beginfunction
183
+ LResult = int(self.__FInfo ['FileVersionLS'] / 65536)
184
+ return LResult
185
+ #endfunction
186
+
187
+ #--------------------------------------------------
188
+ # @property Minor2
189
+ #--------------------------------------------------
190
+ # getter
191
+ @property
192
+ def Minor2(self):
193
+ #beginfunction
194
+ LResult = int(self.__FInfo ['FileVersionLS'] % 65536)
195
+ return LResult
196
+ #endfunction
197
+
198
+ #--------------------------------------------------
199
+ # @property Lang1
200
+ #--------------------------------------------------
201
+ # getter
202
+ @property
203
+ def Lang1(self):
204
+ #beginfunction
205
+ #Result = self.__FTransInfo.dwLang1
206
+ LResult = ''
207
+ return LResult
208
+ #endfunction
209
+
210
+ #--------------------------------------------------
211
+ # @property Lang2
212
+ #--------------------------------------------------
213
+ # getter
214
+ @property
215
+ def Lang2(self):
216
+ #beginfunction
217
+ #Result = self.__FTransInfo.dwLang2
218
+ LResult = ''
219
+ return LResult
220
+ #endfunction
221
+
222
+ #--------------------------------------------------
223
+ # @property LangCharSet
224
+ #--------------------------------------------------
225
+ # getter
226
+ @property
227
+ def LangCharSet(self):
228
+ #beginfunction
229
+ #Result = IntToHex(Lang1,4)+IntToHex(Lang2,4)
230
+ LResult = ''
231
+ return LResult
232
+ #endfunction
233
+
234
+ #--------------------------------------------------
235
+ # @property FileVersion
236
+ #--------------------------------------------------
237
+ # getter
238
+ @property
239
+ def FileVersion(self):
240
+ #beginfunction
241
+ LResult = self.__FFileVersion
242
+ return LResult
243
+ #endfunction
244
+
245
+ #--------------------------------------------------
246
+ # @property FileDate
247
+ #--------------------------------------------------
248
+ # getter
249
+ @property
250
+ def FileDate(self):
251
+ #beginfunction
252
+ LResult = self.__FFileDate
253
+ return LResult
254
+ #endfunction
255
+
256
+ #--------------------------------------------------
257
+ # @property CompanyName
258
+ #--------------------------------------------------
259
+ # getter
260
+ @property
261
+ def CompanyName(self):
262
+ #beginfunction
263
+ LResult = self.__FCompanyName
264
+ return LResult
265
+ #endfunction
266
+
267
+ #--------------------------------------------------
268
+ # @property FileDescription
269
+ #--------------------------------------------------
270
+ # getter
271
+ @property
272
+ def FileDescription(self):
273
+ #beginfunction
274
+ LResult = self.__FFileDescription
275
+ return LResult
276
+ #endfunction
277
+
278
+ #--------------------------------------------------
279
+ # @property InternalName
280
+ #--------------------------------------------------
281
+ # getter
282
+ @property
283
+ def InternalName(self):
284
+ #beginfunction
285
+ LResult = self.__FInternalName
286
+ return LResult
287
+ #endfunction
288
+
289
+ #--------------------------------------------------
290
+ # @property LegalCopyright
291
+ #--------------------------------------------------
292
+ # getter
293
+ @property
294
+ def LegalCopyright(self):
295
+ #beginfunction
296
+ LResult = self.__FLegalCopyright
297
+ return LResult
298
+ #endfunction
299
+
300
+ #--------------------------------------------------
301
+ # @property LegalTrademarks
302
+ #--------------------------------------------------
303
+ # getter
304
+ @property
305
+ def LegalTrademarks(self):
306
+ #beginfunction
307
+ LResult = self.__FLegalTrademarks
308
+ return LResult
309
+ #endfunction
310
+
311
+ #--------------------------------------------------
312
+ # @property OriginalFilename
313
+ #--------------------------------------------------
314
+ # getter
315
+ @property
316
+ def OriginalFilename(self):
317
+ #beginfunction
318
+ LResult = self.__FOriginalFilename
319
+ return LResult
320
+ #endfunction
321
+
322
+ #--------------------------------------------------
323
+ # @property ProductName
324
+ #--------------------------------------------------
325
+ # getter
326
+ @property
327
+ def ProductName(self):
328
+ #beginfunction
329
+ LResult = self.__FProductName
330
+ return LResult
331
+ #endfunction
332
+
333
+ #--------------------------------------------------
334
+ # @property ProductVersion
335
+ #--------------------------------------------------
336
+ # getter
337
+ @property
338
+ def ProductVersion(self):
339
+ #beginfunction
340
+ LResult = self.__FProductVersion
341
+ return LResult
342
+ #endfunction
343
+
344
+ #--------------------------------------------------
345
+ # @property Comments
346
+ #--------------------------------------------------
347
+ # getter
348
+ @property
349
+ def Comments(self):
350
+ #beginfunction
351
+ LResult = self.__FComments
352
+ return LResult
353
+ #endfunction
354
+ #endclass
355
+
356
+ #-------------------------------------------------------------------------------
357
+ # CreateVersion
358
+ #-------------------------------------------------------------------------------
359
+ def CreateVersion (AFileName: str) -> TVersionInfo:
360
+ """CreateVersion"""
361
+ #beginfunction
362
+ LResult:TVersionInfo = TVersionInfo ()
363
+ LResult.__FFileName = AFileName
364
+ return LResult
365
+ #endfunction
366
+
367
+ #---------------------------------------------------------
368
+ # main
369
+ #---------------------------------------------------------
370
+ def main ():
371
+ #beginfunction
372
+ ...
373
+ #endfunction
374
+
375
+ #---------------------------------------------------------
376
+ #
377
+ #---------------------------------------------------------
378
+ #beginmodule
379
+ if __name__ == "__main__":
380
+ main()
381
+ #endif
382
+
383
+ #endmodule