ScriptCollection 4.4.36__py3-none-any.whl → 4.4.37__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.
- ScriptCollection/ScriptCollectionCore.py +14 -7
- ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py +3 -2
- {scriptcollection-4.4.36.dist-info → scriptcollection-4.4.37.dist-info}/METADATA +1 -1
- {scriptcollection-4.4.36.dist-info → scriptcollection-4.4.37.dist-info}/RECORD +7 -7
- {scriptcollection-4.4.36.dist-info → scriptcollection-4.4.37.dist-info}/WHEEL +0 -0
- {scriptcollection-4.4.36.dist-info → scriptcollection-4.4.37.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.4.36.dist-info → scriptcollection-4.4.37.dist-info}/top_level.txt +0 -0
|
@@ -40,7 +40,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
40
40
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
41
41
|
from .SCLog import SCLog, LogLevel
|
|
42
42
|
|
|
43
|
-
version = "4.4.
|
|
43
|
+
version = "4.4.37"
|
|
44
44
|
__version__ = version
|
|
45
45
|
|
|
46
46
|
class VSCodeWorkspaceShellTask:
|
|
@@ -1826,7 +1826,7 @@ class ScriptCollectionCore:
|
|
|
1826
1826
|
os.remove(thumbnail_to_delete)
|
|
1827
1827
|
|
|
1828
1828
|
@GeneralUtilities.check_arguments
|
|
1829
|
-
def start_rtsp_test_stream(self, target_address: str, additional_text: str = None, width: int = 640, height: int = 480, frames_per_second: int = 10, font_file: str = None, working_directory: str = None) -> int:
|
|
1829
|
+
def start_rtsp_test_stream(self, target_address: str, additional_text: str = None, width: int = 640, height: int = 480, frames_per_second: int = 10, font_file: str = None, working_directory: str = None, background_color: str = "black") -> int:
|
|
1830
1830
|
"""Starts a video-stream which shows a number that is counted up once per second and publishes it to the
|
|
1831
1831
|
given rtsp-address. Returns the process-id of the running ffmpeg, which can be passed to
|
|
1832
1832
|
GeneralUtilities.kill_process to stop the stream again.
|
|
@@ -1844,9 +1844,11 @@ stream; ffmpeg does not open a port by itself.
|
|
|
1844
1844
|
for the filter-syntax of ffmpeg, and a stream which only exists for testcases does not
|
|
1845
1845
|
need a text which requires that.
|
|
1846
1846
|
:param font_file: The font which is used. When it is not given then a font of the operating-system is used.
|
|
1847
|
+
:param background_color: The color of the background, in the notation ffmpeg uses for a color (a name like
|
|
1848
|
+
"black" or "blue", or "0xRRGGBB", or "#RRGGBB").
|
|
1847
1849
|
"""
|
|
1848
1850
|
GeneralUtilities.assert_condition(target_address.startswith("rtsp://"), f"'{target_address}' is not a rtsp-address.")
|
|
1849
|
-
argument: list[str] = self.__get_arguments_for_test_stream(additional_text, width, height, frames_per_second, font_file) + [
|
|
1851
|
+
argument: list[str] = self.__get_arguments_for_test_stream(additional_text, width, height, frames_per_second, font_file, background_color) + [
|
|
1850
1852
|
"-f", "rtsp",
|
|
1851
1853
|
# Tcp instead of udp, because udp loses pictures under load, which would make a screenshot show
|
|
1852
1854
|
# something else than the number which belongs to the moment it was taken.
|
|
@@ -1855,7 +1857,7 @@ stream; ffmpeg does not open a port by itself.
|
|
|
1855
1857
|
return self.run_program_argsasarray_async("ffmpeg", argument, working_directory, title=f"RTSP-test-stream ({target_address})")
|
|
1856
1858
|
|
|
1857
1859
|
@GeneralUtilities.check_arguments
|
|
1858
|
-
def create_test_stream_video(self, target_file: str, duration_in_seconds: int, additional_text: str = None, width: int = 640, height: int = 480, frames_per_second: int = 10, font_file: str = None, working_directory: str = None) -> None:
|
|
1860
|
+
def create_test_stream_video(self, target_file: str, duration_in_seconds: int, additional_text: str = None, width: int = 640, height: int = 480, frames_per_second: int = 10, font_file: str = None, working_directory: str = None, background_color: str = "black") -> None:
|
|
1859
1861
|
"""Writes a video-file which shows the same picture as start_rtsp_test_stream, but into a file instead of
|
|
1860
1862
|
to a rtsp-address and as fast as possible instead of in realtime.
|
|
1861
1863
|
|
|
@@ -1865,18 +1867,23 @@ are the same, so a picture of this file can be used as the baseline for a pictur
|
|
|
1865
1867
|
:param target_file: The video-file which is written.
|
|
1866
1868
|
:param duration_in_seconds: How long the video is. The number is counted up once per second, so a video of ten
|
|
1867
1869
|
seconds contains the numbers 0 to 9.
|
|
1870
|
+
:param background_color: The color of the background. It has to be the one the stream is started with, otherwise
|
|
1871
|
+
a picture of this file does not show the same as a picture of that stream.
|
|
1868
1872
|
"""
|
|
1869
|
-
argument: list[str] = self.__get_arguments_for_test_stream(additional_text, width, height, frames_per_second, font_file, realtime=False) + [
|
|
1873
|
+
argument: list[str] = self.__get_arguments_for_test_stream(additional_text, width, height, frames_per_second, font_file, background_color, realtime=False) + [
|
|
1870
1874
|
"-t", str(duration_in_seconds),
|
|
1871
1875
|
"-y", target_file]
|
|
1872
1876
|
self.run_program_argsasarray("ffmpeg", argument, working_directory, throw_exception_if_exitcode_is_not_zero=True)
|
|
1873
1877
|
|
|
1874
1878
|
@GeneralUtilities.check_arguments
|
|
1875
|
-
def __get_arguments_for_test_stream(self, additional_text: str, width: int, height: int, frames_per_second: int, font_file: str, realtime: bool = True) -> list[str]:
|
|
1879
|
+
def __get_arguments_for_test_stream(self, additional_text: str, width: int, height: int, frames_per_second: int, font_file: str, background_color: str, realtime: bool = True) -> list[str]:
|
|
1876
1880
|
"""Returns the ffmpeg-arguments which produce the picture of a test-stream. The picture is defined here
|
|
1877
1881
|
only once, so that the video which is used as the expected result really shows the same as the stream."""
|
|
1878
1882
|
if additional_text is not None:
|
|
1879
1883
|
GeneralUtilities.assert_condition(re.fullmatch("[a-zA-Z0-9 ]+", additional_text) is not None, f"The additional text must consist of letters, digits and spaces only, but it is '{additional_text}'.")
|
|
1884
|
+
# The color is put into the description of the lavfi-source, whose parts are separated by colons, so a
|
|
1885
|
+
# value which contains one would not be a color anymore but an additional option of that source.
|
|
1886
|
+
GeneralUtilities.assert_condition(re.fullmatch("[a-zA-Z0-9#]+", background_color) is not None, f"The background-color must consist of letters, digits and the number-sign only, but it is '{background_color}'.")
|
|
1880
1887
|
if font_file is None:
|
|
1881
1888
|
font_file = self.__get_font_file_for_drawing_text()
|
|
1882
1889
|
# "%{eif:t:d}" is the amount of seconds the stream is running, rounded down to an integer, so the number
|
|
@@ -1893,7 +1900,7 @@ only once, so that the video which is used as the expected result really shows t
|
|
|
1893
1900
|
result.append("-re")
|
|
1894
1901
|
result = result + [
|
|
1895
1902
|
"-f", "lavfi",
|
|
1896
|
-
"-i", f"color=c=
|
|
1903
|
+
"-i", f"color=c={background_color}:s={width}x{height}:r={frames_per_second}",
|
|
1897
1904
|
"-vf", ",".join(text_filters),
|
|
1898
1905
|
"-c:v", "libx264",
|
|
1899
1906
|
"-preset", "ultrafast",
|
|
@@ -213,7 +213,8 @@ class TFCPS_CodeUnitSpecific_NodeJS_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
213
213
|
for unit in root.findall(f".//{ns_prefix}unit"):
|
|
214
214
|
for segment in unit.findall(f"{ns_prefix}segment"):
|
|
215
215
|
segment.set("state", "initial")
|
|
216
|
-
tree.write
|
|
216
|
+
with open(target_file, "wb") as f:#binary mode (as opposed to passing the filename directly to tree.write): guarantees LF line-endings regardless of the OS' default line-ending, since binary mode never translates "\n" to "\r\n". The line-endings of the content copied from the base-file are normalized to LF too, because an XML-parser normalizes "\r\n" and "\r" to "\n" while parsing.
|
|
217
|
+
tree.write(f, encoding="utf-8", xml_declaration=True)
|
|
217
218
|
|
|
218
219
|
angular_json_file=self.get_codeunit_folder()+"/angular.json"
|
|
219
220
|
if os.path.isfile(angular_json_file):
|
|
@@ -226,7 +227,7 @@ class TFCPS_CodeUnitSpecific_NodeJS_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
226
227
|
for lang in languages
|
|
227
228
|
}
|
|
228
229
|
i18n_config.setdefault("locales", {}).update(new_locales)
|
|
229
|
-
with angular_json_path.open("w", encoding="utf-8") as f:
|
|
230
|
+
with angular_json_path.open("w", encoding="utf-8", newline="\n") as f:#newline="\n": guarantees LF line-endings regardless of the OS' default line-ending, since without this Python would translate "\n" to "\r\n" on Windows.
|
|
230
231
|
json.dump(angular_config, f, ensure_ascii=False, indent=2)
|
|
231
232
|
|
|
232
233
|
@GeneralUtilities.check_arguments
|
|
@@ -12,7 +12,7 @@ ScriptCollection/ProgramRunnerSudo.py,sha256=ot9Ib-plQ8wejR9M2XXfnx6GR-va9k8SH1g
|
|
|
12
12
|
ScriptCollection/RepositoryDiagramGenerator.py,sha256=K_u2NW_p4ozdWD50irJEkkcDVa70TcUJpZN63TeXSLw,7092
|
|
13
13
|
ScriptCollection/RepositoryHistoryAnalyzer.py,sha256=rD8eC5lMUe5MHmCBHfYft_G-N9IbvtsFGkU7EMwPjrY,5779
|
|
14
14
|
ScriptCollection/SCLog.py,sha256=Fjf8Pdi63cXHGMxL_aI6A0dwGm7QIfrv3czjvpSUlaM,4705
|
|
15
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
15
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=iLIOReXAMN7c_HRlZtgjEqvwfdZVAneHLqLlyE-TDHg,301342
|
|
16
16
|
ScriptCollection/TestKind.py,sha256=jqLJwNvQeyea7SZf-UFzMC9pM0znv4do7FIC1xq8u9M,1672
|
|
17
17
|
ScriptCollection/UnassignedVariablesCheck.py,sha256=8xNcp1D5HeOLO1a1NEerq2TsnpFhw7yzYPkaay-oisY,3804
|
|
18
18
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -65,7 +65,7 @@ ScriptCollection/TFCPS/Go/TFCPS_CodeUnitSpecific_Go.py,sha256=m4Pax-U6o5XuspLnLf
|
|
|
65
65
|
ScriptCollection/TFCPS/Go/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
66
|
ScriptCollection/TFCPS/Maven/TFCPS_CodeUnitSpecific_Maven.py,sha256=HDZlU70lF4nxUgsi7-TaFrFpbw_imw6dBagfgL6tDW8,10593
|
|
67
67
|
ScriptCollection/TFCPS/Maven/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
-
ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=
|
|
68
|
+
ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=kYh2C1B6cKfDeRR-CkOqGBV5T3VA9Z-tNKthU5GR6S4,17096
|
|
69
69
|
ScriptCollection/TFCPS/NodeJS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
70
|
ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=Wi9anRljuvW1-UplYhI_QNR2szxaitHiXVJ6p4nUEI8,21089
|
|
71
71
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -73,8 +73,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
|
|
|
73
73
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
74
|
ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=ILVhJHvwG5TvPBBqSvyACYb7W9QnWrJpxKgHu8IQu4g,9249
|
|
75
75
|
ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
|
-
scriptcollection-4.4.
|
|
77
|
-
scriptcollection-4.4.
|
|
78
|
-
scriptcollection-4.4.
|
|
79
|
-
scriptcollection-4.4.
|
|
80
|
-
scriptcollection-4.4.
|
|
76
|
+
scriptcollection-4.4.37.dist-info/METADATA,sha256=AqDa8mTOK0P5tOnIYj-XOQnbUwAFTqdMqQ2dz9VCn9s,7646
|
|
77
|
+
scriptcollection-4.4.37.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
78
|
+
scriptcollection-4.4.37.dist-info/entry_points.txt,sha256=GNma7tN0J59EvK71su-G1w22RnZ05bXcPrELyLx3AL0,6151
|
|
79
|
+
scriptcollection-4.4.37.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
80
|
+
scriptcollection-4.4.37.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|