ScriptCollection 3.3.67__py3-none-any.whl → 3.3.68__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.
@@ -1,7 +1,6 @@
1
1
  from datetime import timedelta, datetime
2
2
  import binascii
3
3
  import filecmp
4
- import sys
5
4
  import hashlib
6
5
  from io import BytesIO
7
6
  import itertools
@@ -27,7 +26,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
27
26
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
28
27
 
29
28
 
30
- version = "3.3.67"
29
+ version = "3.3.68"
31
30
  __version__ = version
32
31
 
33
32
 
@@ -1239,11 +1238,23 @@ class ScriptCollectionCore:
1239
1238
  timeoutInSeconds, addLogOverhead, title, log_namespace, arguments_for_log, custom_argument)
1240
1239
  pid = process.pid
1241
1240
 
1242
- if program_manages_output_itself:
1243
- for c in iter(lambda: process.stdout.read(1), b""):
1244
- sys.stdout.buffer.write(c)
1245
- for c in iter(lambda: process.stderr.read(1), b""):
1246
- sys.stderr.buffer.write(c)
1241
+ if program_manages_logging_itself:
1242
+ stdout_readable = process.stdout.readable()
1243
+ stderr_readable = process.stderr.readable()
1244
+ while stdout_readable or stderr_readable:
1245
+
1246
+ if stdout_readable:
1247
+ stdout_line = GeneralUtilities.bytes_to_string(process.stdout.readline()).strip()
1248
+ if (len(stdout_line)) > 0:
1249
+ GeneralUtilities.write_message_to_stdout(stdout_line)
1250
+
1251
+ if stderr_readable:
1252
+ stderr_line = GeneralUtilities.bytes_to_string(process.stderr.readline()).strip()
1253
+ if (len(stderr_line)) > 0:
1254
+ GeneralUtilities.write_message_to_stderr(stderr_line)
1255
+
1256
+ stdout_readable = process.stdout.readable()
1257
+ stderr_readable = process.stderr.readable()
1247
1258
 
1248
1259
  stdout, stderr = process.communicate()
1249
1260
  exit_code = process.wait()
@@ -1470,8 +1481,8 @@ class ScriptCollectionCore:
1470
1481
  @GeneralUtilities.check_arguments
1471
1482
  def get_semver_version_from_gitversion(self, repository_folder: str) -> str:
1472
1483
  result = self.get_version_from_gitversion(repository_folder, "MajorMinorPatch")
1473
- #repository_has_uncommitted_changes = self.git_repository_has_uncommitted_changes(repository_folder)
1474
- #if repository_has_uncommitted_changes:
1484
+ # repository_has_uncommitted_changes = self.git_repository_has_uncommitted_changes(repository_folder)
1485
+ # if repository_has_uncommitted_changes:
1475
1486
  # if self.get_current_branch_has_tag(repository_folder):
1476
1487
  # tag_of_latest_tag = self.git_get_commitid_of_tag(repository_folder, self.get_latest_tag(repository_folder))
1477
1488
  # current_commit = self.git_get_commit_id(repository_folder)
@@ -1245,7 +1245,7 @@ class TasksForCommonProjectStructure:
1245
1245
  GeneralUtilities.write_text_to_file(docker_compose_file, replaced)
1246
1246
 
1247
1247
  @GeneralUtilities.check_arguments
1248
- def run_dockerfile_example(self, current_file: str, verbosity: int = 3, remove_old_container: bool = False, commandline_arguments: list[str] = []):
1248
+ def run_dockerfile_example(self, current_file: str, verbosity: int, remove_old_container: bool, remove_volumes_folder: bool, commandline_arguments: list[str]):
1249
1249
  verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, verbosity)
1250
1250
  folder = os.path.dirname(current_file)
1251
1251
  example_name = os.path.basename(folder)
@@ -1258,12 +1258,17 @@ class TasksForCommonProjectStructure:
1258
1258
  if remove_old_container:
1259
1259
  GeneralUtilities.write_message_to_stdout(f"Ensure container {codeunit_name_lower} does not exist...")
1260
1260
  sc.run_program("docker", f"container rm -f {codeunit_name_lower}", oci_image_artifacts_folder, verbosity=verbosity)
1261
+ if remove_volumes_folder:
1262
+ volumes_folder = os.path.join(folder, "Volumes")
1263
+ GeneralUtilities.write_message_to_stdout(f"Ensure volumes-folder '{volumes_folder}' does not exist...")
1264
+ GeneralUtilities.ensure_directory_does_not_exist(volumes_folder)
1261
1265
  GeneralUtilities.write_message_to_stdout("Load docker-image...")
1262
1266
  sc.run_program("docker", f"load -i {image_filename}", oci_image_artifacts_folder, verbosity=verbosity)
1263
1267
  project_name = f"{codeunit_name}_{example_name}".lower()
1264
- sc.program_runner = ProgramRunnerEpew()
1268
+ sc_epew = ScriptCollectionCore()
1269
+ sc_epew.program_runner = ProgramRunnerEpew()
1265
1270
  GeneralUtilities.write_message_to_stdout("Start docker-container...")
1266
- sc.run_program("docker-compose", f"--project-name {project_name} up", folder, verbosity=verbosity)
1271
+ sc_epew.run_program("docker-compose", f"--project-name {project_name} up", folder, verbosity=verbosity)
1267
1272
 
1268
1273
  @GeneralUtilities.check_arguments
1269
1274
  def _internal_sort_codenits(self, codeunits=dict[str, set[str]]) -> list[str]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ScriptCollection
3
- Version: 3.3.67
3
+ Version: 3.3.68
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Home-page: https://github.com/anionDev/ScriptCollection
6
6
  Author: Marius Göcke
@@ -3,12 +3,12 @@ ScriptCollection/GeneralUtilities.py,sha256=Blo0Iq-G4zuUL5oUxBTeGFtQ23ndK7dpZPOj
3
3
  ScriptCollection/ProgramRunnerBase.py,sha256=2kyOuoM3oFjBfLc9Q5t5RTz7Ya2CjUxFtB1rBBDmnjU,1937
4
4
  ScriptCollection/ProgramRunnerEpew.py,sha256=ZiBZVMcsphmo49z2BwUwQYXo2uTKXPu33QW3IxCT46E,6273
5
5
  ScriptCollection/ProgramRunnerPopen.py,sha256=HOs1QVnXiQtwXy1_xvH79bWBdd0i-2tUyyLloQBvMto,3023
6
- ScriptCollection/ScriptCollectionCore.py,sha256=AaqVkBaeQIZi6wSoAsY-vLwYaPT045ASo740q53z_e4,86136
7
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=JUqkBOqA3DlZqCOOODPmprlmHJSRBHzYCQENsBWb10U,106445
6
+ ScriptCollection/ScriptCollectionCore.py,sha256=GwRqXWlRQiIM8BFLNRruDnsos9YNBg4VpSfKaHP551w,86740
7
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=e-bnGk7ED6JJE0zitVHGxuoRDR_ChhDjY-t31tGKOSw,106801
8
8
  ScriptCollection/UpdateCertificates.py,sha256=Go-JJK-YTi7aBB1phlLxypa8GHkmFHBEPB0_TT9G-bw,7918
9
9
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- ScriptCollection-3.3.67.dist-info/METADATA,sha256=V3bnAt7raah9G_QBMI1a5eYg4LOsrHcI-IdP-P7Xr4A,7878
11
- ScriptCollection-3.3.67.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
12
- ScriptCollection-3.3.67.dist-info/entry_points.txt,sha256=VIuxVCOpX38lSJUwRRENBNgcGKTIBxQyrCfbJVRHP8g,1968
13
- ScriptCollection-3.3.67.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
14
- ScriptCollection-3.3.67.dist-info/RECORD,,
10
+ ScriptCollection-3.3.68.dist-info/METADATA,sha256=-dbkq5Smk0CLIQSp3qPjjtVl9S5zfGd7PwPXy0AJMzs,7878
11
+ ScriptCollection-3.3.68.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
12
+ ScriptCollection-3.3.68.dist-info/entry_points.txt,sha256=VIuxVCOpX38lSJUwRRENBNgcGKTIBxQyrCfbJVRHP8g,1968
13
+ ScriptCollection-3.3.68.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
14
+ ScriptCollection-3.3.68.dist-info/RECORD,,