ScriptCollection 3.5.154__py3-none-any.whl → 3.5.156__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.
@@ -367,12 +367,15 @@ class GeneralUtilities:
367
367
 
368
368
  @staticmethod
369
369
  @check_arguments
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
- if add_timezone_info_to_log:
373
- return datetime_object.strftime(f'{base_pattern} %z')
370
+ def datetime_to_string_for_logfile_entry(datetime_object: datetime, add_milliseconds: bool = False) -> str:
371
+ pattern: str = None
372
+ if add_milliseconds:
373
+ pattern = "%Y-%m-%dT%H:%M:%S.%f%z"
374
374
  else:
375
- return datetime_object.strftime(base_pattern)
375
+ pattern = "%Y-%m-%dT%H:%M:%S%z"
376
+ s = datetime_object.strftime(pattern)
377
+ s = s[:-2] + ":" + s[-2:]
378
+ return s
376
379
 
377
380
  @staticmethod
378
381
  @check_arguments
ScriptCollection/SCLog.py CHANGED
@@ -22,6 +22,7 @@ class SCLog:
22
22
  add_overhead_to_console: bool
23
23
  add_overhead_to_logfile: bool
24
24
  print_as_color: bool
25
+ add_milliseconds_to_logfile_entry: bool
25
26
 
26
27
  def __init__(self, log_file: str = None, loglevel: LogLevel = None, print_as_color: bool = True):
27
28
  self.log_file = log_file
@@ -31,6 +32,7 @@ class SCLog:
31
32
  self.loglevel = loglevel
32
33
  self.add_overhead_to_console = False
33
34
  self.add_overhead_to_logfile = False
35
+ self.add_milliseconds_to_logfile_entry = False
34
36
  self.print_as_color = print_as_color
35
37
 
36
38
  @GeneralUtilities.check_arguments
@@ -70,7 +72,7 @@ class SCLog:
70
72
 
71
73
  moment: datetime = datetime.now(datetime.now().astimezone().tzinfo)
72
74
 
73
- part1 = f"[{GeneralUtilities.datetime_to_string_for_logfile_entry(moment, True)}] ["
75
+ part1 = f"[{GeneralUtilities.datetime_to_string_for_logfile_entry(moment, self.add_milliseconds_to_logfile_entry)}] ["
74
76
  if loglevel == LogLevel.Information:
75
77
  part2 = f"Information"
76
78
  elif loglevel == LogLevel.Error:
@@ -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.154"
38
+ version = "3.5.156"
39
39
  __version__ = version
40
40
 
41
41
 
@@ -2629,12 +2629,6 @@ class TasksForCommonProjectStructure:
2629
2629
  project_version = self.get_version_of_project(repository_folder)
2630
2630
 
2631
2631
  now = datetime.now()
2632
- if not self.__suport_information_exists(repository_folder, project_version):
2633
- support_time = timedelta(days=365*2+30*3+1) # TODO make this configurable
2634
- until = now + support_time
2635
- until_day = datetime(until.year, until.month, until.day, 0, 0, 0)
2636
- from_day = datetime(now.year, now.month, now.day, 0, 0, 0)
2637
- self.mark_current_version_as_supported(repository_folder, project_version, from_day, until_day)
2638
2632
 
2639
2633
  project_resources_folder = os.path.join(repository_folder, "Other", "Scripts")
2640
2634
  PrepareBuildCodeunits_script_name = "PrepareBuildCodeunits.py"
@@ -2649,6 +2643,12 @@ class TasksForCommonProjectStructure:
2649
2643
  raise ValueError(f"PrepareBuildCodeunits.py resulted in exitcode {result[0]}.")
2650
2644
 
2651
2645
  self.__do_repository_checks(repository_folder, project_version)
2646
+ if not self.__suport_information_exists(repository_folder, project_version):
2647
+ support_time = timedelta(days=365*2+30*3+1) # TODO make this configurable
2648
+ until = now + support_time
2649
+ until_day = datetime(until.year, until.month, until.day, 0, 0, 0)
2650
+ from_day = datetime(now.year, now.month, now.day, 0, 0, 0)
2651
+ self.mark_current_version_as_supported(repository_folder, project_version, from_day, until_day)
2652
2652
  self.build_specific_codeunits(repository_folder, codeunits, verbosity, target_environmenttype, additional_arguments_file, is_pre_merge, export_target_directory, False, commandline_arguments, do_git_clean_when_no_changes, note)
2653
2653
 
2654
2654
  @GeneralUtilities.check_arguments
@@ -2677,7 +2677,7 @@ class TasksForCommonProjectStructure:
2677
2677
  sorted_codeunits = [codeunit for codeunit in sorted_codeunits if codeunit in codeunits]
2678
2678
  project_version = self.get_version_of_project(repository_folder)
2679
2679
 
2680
- 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)})"
2681
2681
  if note is not None:
2682
2682
  message = f"{message} ({note})"
2683
2683
  GeneralUtilities.write_message_to_stdout(message)
@@ -2720,7 +2720,7 @@ class TasksForCommonProjectStructure:
2720
2720
  shutil.move(archive_file, target_folder)
2721
2721
 
2722
2722
  now_end: datetime = datetime.now()
2723
- 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)})"
2724
2724
  if note is not None:
2725
2725
  message2 = f"{message2} ({note})"
2726
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.154
3
+ Version: 3.5.156
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=OaecNA7tTFlFA8Wu1dDVspug3DRaRRGbJy4AbpwudpQ,48055
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
- ScriptCollection/SCLog.py,sha256=49NlLEmK_f-icw_uEPq9U3qv-oBTMRcIqSg3jaO8VsA,4360
10
- ScriptCollection/ScriptCollectionCore.py,sha256=vzMtn001WIBWKPgJak1J42iZjpTDrKIgw4Q3ab50AcY,139260
11
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=6m8Mu_G_ydkFn2twYrbf9Kt7YoWZjJnuUztJbl4bZPU,247230
9
+ ScriptCollection/SCLog.py,sha256=rMdrEzBKQZBdObPJ9nZ5XCEXRoIFqPh8fAoiX6ZOVuw,4493
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=Rlj0JQG84M1NcsXOKmqJPW3_tkCOJquPreCYTx0Ne4E,139260
11
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=c4Ohfh8eQK68ObaC2YirTpNy8bht_uHhvxSGQXRgmiQ,247266
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.154.dist-info/METADATA,sha256=heYQXlbf-hXoNwkR2mPredjwCtwMg1Ybs18Ji-8_JxE,7689
14
- scriptcollection-3.5.154.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- scriptcollection-3.5.154.dist-info/entry_points.txt,sha256=yZlEK0r5Ie7xrSLdlWZgFqzLZiIctsIAUJvDCgrYBRo,4193
16
- scriptcollection-3.5.154.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.154.dist-info/RECORD,,
13
+ scriptcollection-3.5.156.dist-info/METADATA,sha256=pXOv4nagWda_5f1tY4A9uqhtBBtlqh4FU-9xUfxMa_Q,7689
14
+ scriptcollection-3.5.156.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ scriptcollection-3.5.156.dist-info/entry_points.txt,sha256=yZlEK0r5Ie7xrSLdlWZgFqzLZiIctsIAUJvDCgrYBRo,4193
16
+ scriptcollection-3.5.156.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.156.dist-info/RECORD,,