ScriptCollection 3.5.153__py3-none-any.whl → 3.5.155__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.
@@ -368,11 +368,10 @@ class GeneralUtilities:
368
368
  @staticmethod
369
369
  @check_arguments
370
370
  def datetime_to_string_for_logfile_entry(datetime_object: datetime, add_timezone_info_to_log: bool = True) -> str:
371
- base_pattern: str = "%Y-%m-%d %H:%M:%S"
372
371
  if add_timezone_info_to_log:
373
- return datetime_object.strftime(f'{base_pattern} %z')
372
+ return datetime_object.isoformat()
374
373
  else:
375
- return datetime_object.strftime(base_pattern)
374
+ return datetime_object.strftime("%Y-%m-%d %H:%M:%S")
376
375
 
377
376
  @staticmethod
378
377
  @check_arguments
@@ -35,7 +35,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
35
35
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
36
36
  from .SCLog import SCLog, LogLevel
37
37
 
38
- version = "3.5.153"
38
+ version = "3.5.155"
39
39
  __version__ = version
40
40
 
41
41
 
@@ -2356,8 +2356,10 @@ TXDX
2356
2356
  GeneralUtilities.write_text_to_file(file, ET.tostring(element, encoding="unicode"), encoding)
2357
2357
 
2358
2358
  @GeneralUtilities.check_arguments
2359
- def install_requirementstxt_file(self, requirements_txt_file: str, folder: str, verbosity: int):
2360
- self.run_program_argsasarray("pip", ["install", "-r", requirements_txt_file], folder, verbosity=verbosity)
2359
+ def install_requirementstxt_file(self, requirements_txt_file: str, verbosity: int):
2360
+ folder:str=os.path.dirname(requirements_txt_file)
2361
+ filename:str=os.path.basename(requirements_txt_file)
2362
+ self.run_program_argsasarray("pip", ["install", "-r", filename], folder, verbosity=verbosity)
2361
2363
 
2362
2364
  @GeneralUtilities.check_arguments
2363
2365
  def ocr_analysis_of_folder(self, folder: str, serviceaddress: str, extensions: list[str], languages: list[str]) -> list[str]: # Returns a list of changed files due to ocr-analysis.
@@ -2450,15 +2452,15 @@ OCR-content:
2450
2452
  new_lines.append(line)
2451
2453
  GeneralUtilities.write_lines_to_file(target_file, new_lines)
2452
2454
 
2453
- def do_and_log_task(self,name_of_task:str,task):
2455
+ def do_and_log_task(self, name_of_task: str, task):
2454
2456
  try:
2455
- self.log.log(f"Start {name_of_task}", LogLevel.Information)
2456
- result= task()
2457
+ self.log.log(f"Start action \"{name_of_task}\".", LogLevel.Information)
2458
+ result = task()
2457
2459
  if result is None:
2458
- result=0
2460
+ result = 0
2459
2461
  return result
2460
2462
  except Exception as e:
2461
- self.log.log_exception(f"Error while {name_of_task}.", e, traceback)
2463
+ self.log.log_exception(f"Error while running action \"{name_of_task}\".", e, traceback)
2462
2464
  return 1
2463
2465
  finally:
2464
- self.log.log(f"Finished {name_of_task}.", LogLevel.Information)
2466
+ self.log.log(f"Finished action \"{name_of_task}\".", LogLevel.Information)
@@ -1376,8 +1376,8 @@ class TasksForCommonProjectStructure:
1376
1376
  return project_version
1377
1377
 
1378
1378
  @GeneralUtilities.check_arguments
1379
- def standardized_tasks_build_for_docker_project(self, build_script_file: str, target_environment_type: str, verbosity: int, commandline_arguments: list[str]) -> None:
1380
- self.standardized_tasks_build_for_docker_project_with_additional_build_arguments(build_script_file, target_environment_type, verbosity, commandline_arguments, dict[str, str]())
1379
+ def standardized_tasks_build_for_docker_project(self, build_script_file: str, target_environment_type: str, verbosity: int, commandline_arguments: list[str], custom_arguments: dict[str, str] = None) -> None:
1380
+ self.standardized_tasks_build_for_docker_project_with_additional_build_arguments(build_script_file, target_environment_type, verbosity, commandline_arguments, custom_arguments)
1381
1381
  self.generate_sbom_for_docker_image(build_script_file, verbosity, commandline_arguments)
1382
1382
 
1383
1383
  @GeneralUtilities.check_arguments
@@ -1416,9 +1416,10 @@ class TasksForCommonProjectStructure:
1416
1416
  codeunit_file = os.path.join(codeunit_folder, f"{codeunitname}.codeunit.xml")
1417
1417
  codeunitversion = self.get_version_of_codeunit(codeunit_file)
1418
1418
  args = ["image", "build", "--pull", "--force-rm", "--progress=plain", "--build-arg", f"TargetEnvironmentType={target_environment_type}", "--build-arg", f"CodeUnitName={codeunitname}", "--build-arg", f"CodeUnitVersion={codeunitversion}", "--build-arg", f"CodeUnitOwnerName={self.get_codeunit_owner_name(codeunit_file)}", "--build-arg", f"CodeUnitOwnerEMailAddress={self.get_codeunit_owner_emailaddress(codeunit_file)}"]
1419
- for custom_argument_key, custom_argument_value in custom_arguments.items():
1420
- args.append("--build-arg")
1421
- args.append(f"{custom_argument_key}={custom_argument_value}")
1419
+ if custom_arguments is not None:
1420
+ for custom_argument_key, custom_argument_value in custom_arguments.items():
1421
+ args.append("--build-arg")
1422
+ args.append(f"{custom_argument_key}={custom_argument_value}")
1422
1423
  args = args+["--tag", f"{codeunitname_lower}:latest", "--tag", f"{codeunitname_lower}:{codeunitversion}", "--file", f"{codeunitname}/Dockerfile"]
1423
1424
  if not use_cache:
1424
1425
  args.append("--no-cache")
@@ -2676,7 +2677,7 @@ class TasksForCommonProjectStructure:
2676
2677
  sorted_codeunits = [codeunit for codeunit in sorted_codeunits if codeunit in codeunits]
2677
2678
  project_version = self.get_version_of_project(repository_folder)
2678
2679
 
2679
- message = f"Build codeunits in product {repository_name}... (Started: {GeneralUtilities.datetime_to_string(now_begin)})"
2680
+ message = f"Build codeunits in product {repository_name}... (Started: {GeneralUtilities.datetime_to_string_for_logfile_entry(now_begin)})"
2680
2681
  if note is not None:
2681
2682
  message = f"{message} ({note})"
2682
2683
  GeneralUtilities.write_message_to_stdout(message)
@@ -2719,7 +2720,7 @@ class TasksForCommonProjectStructure:
2719
2720
  shutil.move(archive_file, target_folder)
2720
2721
 
2721
2722
  now_end: datetime = datetime.now()
2722
- message2 = f"Finished build codeunits in product {repository_name}. (Finished: {GeneralUtilities.datetime_to_string(now_end)})"
2723
+ message2 = f"Finished build codeunits in product {repository_name}. (Finished: {GeneralUtilities.datetime_to_string_for_logfile_entry(now_end)})"
2723
2724
  if note is not None:
2724
2725
  message2 = f"{message2} ({note})"
2725
2726
  GeneralUtilities.write_message_to_stdout(message2)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.153
3
+ Version: 3.5.155
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
@@ -1,17 +1,17 @@
1
1
  ScriptCollection/CertificateUpdater.py,sha256=OAxrG21k_o3W3niOOGNSZzUPJlvolOWc1lRB2dMhc3g,9212
2
2
  ScriptCollection/Executables.py,sha256=BojgHGBYn5QqpsdIgn8r8raxb8bE_BUyb-fZ_rCEN0A,37050
3
- ScriptCollection/GeneralUtilities.py,sha256=t8xp0s10V-MrWYQQiMx0ae3LLTM8G2wPyyWXqeIteXQ,48023
3
+ ScriptCollection/GeneralUtilities.py,sha256=E1Jjgf_Vdc8G4KhCSg7FnyP6R3jRNPpsUiZnjSQ-2zk,47962
4
4
  ScriptCollection/ImageUpdater.py,sha256=qTe3yoqzQJY7LZdXBbjbWvrsSQaeHy1VwmOxaRzU2ig,29305
5
5
  ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
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
9
  ScriptCollection/SCLog.py,sha256=49NlLEmK_f-icw_uEPq9U3qv-oBTMRcIqSg3jaO8VsA,4360
10
- ScriptCollection/ScriptCollectionCore.py,sha256=XzMdqcTRG9UAV3uyZjvWYsa-hbMbSoT3Axb3OqIRMig,139119
11
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=glEoCoC9FotsG4jRu5-LgvvTB_qFntKlXT1kGhgy3s4,247136
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=yLDK7zuBIW0K3y9tK53Bjt2zjEkLgEyKnDq4v0eo78k,139260
11
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=BGmhrkHPbSxo9CQYo1URbERROiDnJSEt5V-b1emX-wQ,247266
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.153.dist-info/METADATA,sha256=JvDOgE8UQCgopI-CORbEa3VeFodQY-YJgXORPqjoUfc,7689
14
- scriptcollection-3.5.153.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- scriptcollection-3.5.153.dist-info/entry_points.txt,sha256=yZlEK0r5Ie7xrSLdlWZgFqzLZiIctsIAUJvDCgrYBRo,4193
16
- scriptcollection-3.5.153.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.153.dist-info/RECORD,,
13
+ scriptcollection-3.5.155.dist-info/METADATA,sha256=Y0a-2LHPG_-uCQpwJgXZjMu5rJczHCqu_IXRpLhguxU,7689
14
+ scriptcollection-3.5.155.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ scriptcollection-3.5.155.dist-info/entry_points.txt,sha256=yZlEK0r5Ie7xrSLdlWZgFqzLZiIctsIAUJvDCgrYBRo,4193
16
+ scriptcollection-3.5.155.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.155.dist-info/RECORD,,