ScriptCollection 3.5.130__py3-none-any.whl → 3.5.132__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/SCLog.py CHANGED
@@ -10,6 +10,7 @@ class LogLevel(Enum):
10
10
  Warning = 2
11
11
  Information = 3
12
12
  Debug = 4
13
+ Diagnostic = 5
13
14
 
14
15
  def __int__(self):
15
16
  return self.value
@@ -59,6 +60,8 @@ class SCLog:
59
60
  part3 = f"Warning: {message}"
60
61
  if loglevel == LogLevel.Debug:
61
62
  part3 = f"Debug: {message}"
63
+ if loglevel == LogLevel.Diagnostic:
64
+ part3 = f"Diagnostic: {message}"
62
65
  if self.add_overhead:
63
66
  moment: datetime = None
64
67
  if self.zone_of_time is None:
@@ -74,6 +77,8 @@ class SCLog:
74
77
  part2 = f"Warning"
75
78
  elif loglevel == LogLevel.Debug:
76
79
  part2 = f"Debug"
80
+ elif loglevel == LogLevel.Diagnostic:
81
+ part2 = f"Diagnostic"
77
82
  else:
78
83
  raise ValueError("Unknown loglevel.")
79
84
  part3 = f"] {message}"
@@ -88,6 +93,8 @@ class SCLog:
88
93
  GeneralUtilities.print_text_in_yellow(part2, print_to_std_out, self.print_as_color)
89
94
  elif loglevel == LogLevel.Debug:
90
95
  GeneralUtilities.print_text_in_cyan(part2, print_to_std_out, self.print_as_color)
96
+ elif loglevel == LogLevel.Debug:
97
+ GeneralUtilities.print_text_in_cyan(part2, print_to_std_out, self.print_as_color)
91
98
  else:
92
99
  raise ValueError("Unknown loglevel.")
93
100
  GeneralUtilities.print_text(part3+"\n", print_to_std_out)
@@ -33,7 +33,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
33
33
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
34
34
  from .SCLog import SCLog, LogLevel
35
35
 
36
- version = "3.5.130"
36
+ version = "3.5.132"
37
37
  __version__ = version
38
38
 
39
39
 
@@ -1547,6 +1547,9 @@ class ScriptCollectionCore:
1547
1547
  if out_line.startswith("Debug: "):
1548
1548
  loglevel = LogLevel.Debug
1549
1549
  out_line = out_line[len("Debug: "):]
1550
+ if out_line.startswith("Diagnostic: "):
1551
+ loglevel = LogLevel.Diagnostic
1552
+ out_line = out_line[len("Diagnostic: "):]
1550
1553
  log.log(out_line, loglevel)
1551
1554
  # if print_live_output:
1552
1555
  # sys.stdout.flush()
@@ -1609,6 +1612,7 @@ class ScriptCollectionCore:
1609
1612
  verbose = verbosity > 2
1610
1613
  if verbose:
1611
1614
  self.log.log(f"Run '{info_for_log}'.", LogLevel.Debug)
1615
+ self.log.log(f"Run '{info_for_log}' with the following properties: verbosity={verbosity}; timeoutInSeconds={timeoutInSeconds}, print_live_output={print_live_output}.", LogLevel.Diagnostic)
1612
1616
 
1613
1617
  exit_code: int = None
1614
1618
  stdout: str = GeneralUtilities.empty_string
@@ -1427,7 +1427,7 @@ class TasksForCommonProjectStructure:
1427
1427
  self.__sc.format_xml_file(sbom_folder+f"/{codeunitname}.{codeunitversion}.sbom.xml")
1428
1428
 
1429
1429
  @GeneralUtilities.check_arguments
1430
- def push_docker_build_artifact(self, push_artifacts_file: str, registry: str, verbosity: int, push_readme: bool, commandline_arguments: list[str], repository_folder_name: str, image_name: str = None) -> None:
1430
+ def push_docker_build_artifact(self, push_artifacts_file: str, registry: str, verbosity: int, push_readme: bool, commandline_arguments: list[str], repository_folder_name: str, remote_image_name: str = None) -> None:
1431
1431
  folder_of_this_file = os.path.dirname(push_artifacts_file)
1432
1432
  filename = os.path.basename(push_artifacts_file)
1433
1433
  codeunitname_regex: str = "([a-zA-Z0-9]+)"
@@ -1445,22 +1445,23 @@ class TasksForCommonProjectStructure:
1445
1445
  image_file = sc.find_file_by_extension(applicationimage_folder, "tar")
1446
1446
  image_filename = os.path.basename(image_file)
1447
1447
  codeunit_version = self.get_version_of_codeunit(os.path.join(codeunit_folder, f"{codeunitname}.codeunit.xml"))
1448
- if image_name is None:
1449
- image_name = codeunitname
1450
- image_name = image_name.lower()
1451
- repo = f"{registry}/{image_name}"
1452
- image_latest = f"{repo}:latest"
1453
- image_version = f"{repo}:{codeunit_version}"
1448
+ if remote_image_name is None:
1449
+ remote_image_name = codeunitname
1450
+ remote_image_name = remote_image_name.lower()
1451
+ local_image_name = codeunitname.lower()
1452
+ remote_repo = f"{registry}/{remote_image_name}"
1453
+ remote_image_latest = f"{remote_repo}:latest"
1454
+ remote_image_version = f"{remote_repo}:{codeunit_version}"
1454
1455
  GeneralUtilities.write_message_to_stdout("Load image...")
1455
1456
  sc.run_program("docker", f"load --input {image_filename}", applicationimage_folder, verbosity=verbosity)
1456
1457
  GeneralUtilities.write_message_to_stdout("Tag image...")
1457
- sc.run_program("docker", f"tag {image_name}:{codeunit_version} {image_latest}", verbosity=verbosity)
1458
- sc.run_program("docker", f"tag {image_name}:{codeunit_version} {image_version}", verbosity=verbosity)
1458
+ sc.run_program("docker", f"tag {local_image_name}:{codeunit_version} {remote_image_latest}", verbosity=verbosity)
1459
+ sc.run_program("docker", f"tag {local_image_name}:{codeunit_version} {remote_image_version}", verbosity=verbosity)
1459
1460
  GeneralUtilities.write_message_to_stdout("Push image...")
1460
- sc.run_program("docker", f"push {image_latest}", verbosity=verbosity)
1461
- sc.run_program("docker", f"push {image_version}", verbosity=verbosity)
1461
+ sc.run_program("docker", f"push {remote_image_latest}", verbosity=verbosity)
1462
+ sc.run_program("docker", f"push {remote_image_version}", verbosity=verbosity)
1462
1463
  if push_readme:
1463
- sc.run_program("docker-pushrm", f"{repo}", codeunit_folder, verbosity=verbosity)
1464
+ sc.run_program("docker-pushrm", f"{remote_repo}", codeunit_folder, verbosity=verbosity)
1464
1465
 
1465
1466
  @GeneralUtilities.check_arguments
1466
1467
  def get_dependent_code_units(self, codeunit_file: str) -> list[str]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.130
3
+ Version: 3.5.132
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
@@ -6,12 +6,12 @@ ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZ
6
6
  ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4bQNM6RV6Y,2480
7
7
  ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
8
8
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
9
- ScriptCollection/SCLog.py,sha256=2oWISBU4RhAWBPtsM_nPWiOJ6UZEY1T4O9iXtjhRZ24,3685
10
- ScriptCollection/ScriptCollectionCore.py,sha256=-YAKiqEnKLW3658QN1vszI8IaoXUg6vFuXvmfDn44NI,128523
11
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=YdlVfTnVeAuYFqqqgXaf1gw2LtY0OO9cnrOXFQaRXYE,235511
9
+ ScriptCollection/SCLog.py,sha256=Dd2P8vH2PA830wAv6bchlMHHdGE_7At-F4WQY5w4XdA,4016
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=VIsb3OOyWeDNqSuf_ZahDeKcmk1fSana_beEfM4bQRQ,128945
11
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=jb7Nlejn1WDw58gV5VV48KdLK2Z58yPId7WZkwWuz4o,235683
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.130.dist-info/METADATA,sha256=9oPdDiG-UzAZAaYhIVs2RQIU1ZlcQkzxHSwFSeHGuew,7694
14
- scriptcollection-3.5.130.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
15
- scriptcollection-3.5.130.dist-info/entry_points.txt,sha256=3qMbfZEMhc_VTJj-bcLwB8AWcn9iXSB3l0AWpuu52Bs,3689
16
- scriptcollection-3.5.130.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.130.dist-info/RECORD,,
13
+ scriptcollection-3.5.132.dist-info/METADATA,sha256=BKgZDJMo1BgEFFDKPG0-zpz_F8_zS23WsA4f6A4WEA4,7694
14
+ scriptcollection-3.5.132.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
15
+ scriptcollection-3.5.132.dist-info/entry_points.txt,sha256=3qMbfZEMhc_VTJj-bcLwB8AWcn9iXSB3l0AWpuu52Bs,3689
16
+ scriptcollection-3.5.132.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.132.dist-info/RECORD,,