ScriptCollection 3.5.122__py3-none-any.whl → 3.5.124__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.
@@ -22,7 +22,6 @@ from os.path import isfile, join, isdir
22
22
  from pathlib import Path
23
23
  from shutil import copyfile
24
24
  import typing
25
- from typing import TextIO
26
25
  import psutil
27
26
  from defusedxml.minidom import parse
28
27
  from OpenSSL import crypto
@@ -245,7 +244,8 @@ class GeneralUtilities:
245
244
  @staticmethod
246
245
  @check_arguments
247
246
  def print_text(text: str, print_to_stdout: bool = True):
248
- GeneralUtilities.__print_text_to_console(text, print_to_stdout)
247
+ stream: object = sys.stdout if print_to_stdout else sys.stderr
248
+ GeneralUtilities.__print_text_to_console(text, stream)
249
249
 
250
250
  @staticmethod
251
251
  @check_arguments
@@ -270,14 +270,14 @@ class GeneralUtilities:
270
270
  @staticmethod
271
271
  @check_arguments
272
272
  def print_text_in_color(text: str, colorcode: int, print_to_stdout: bool = True, print_as_color: bool = True):
273
- stream: TextIO = sys.stdout if print_to_stdout else sys.stderr
273
+ stream: object = sys.stdout if print_to_stdout else sys.stderr
274
274
  if print_as_color:
275
275
  text = f"\033[{colorcode}m{text}\033[0m"
276
- GeneralUtilities.__print_text_to_console(text, stream, print_to_stdout)
276
+ GeneralUtilities.__print_text_to_console(text, stream)
277
277
 
278
278
  @staticmethod
279
279
  @check_arguments
280
- def __print_text_to_console(text: str, stream: TextIO, print_to_stdout: bool = True):
280
+ def __print_text_to_console(text: str, stream: object):
281
281
  stream.write(text)
282
282
  stream.flush()
283
283
 
ScriptCollection/SCLog.py CHANGED
@@ -24,7 +24,10 @@ class SCLog:
24
24
 
25
25
  def __init__(self, log_file: str = None, loglevel: LogLevel = None, add_overhead: bool = False, print_as_color: bool = True):
26
26
  self.log_file = log_file
27
- self.loglevel = loglevel
27
+ if loglevel is None:
28
+ self.loglevel = loglevel
29
+ else:
30
+ self.loglevel = LogLevel.Information
28
31
  self.add_overhead = add_overhead
29
32
  self.print_as_color = print_as_color
30
33
 
@@ -45,6 +48,9 @@ class SCLog:
45
48
  if int(loglevel) > int(self.loglevel):
46
49
  return
47
50
 
51
+ if message.endswith("\n"):
52
+ GeneralUtilities.write_message_to_stderr(f"invalid line: '{message}'") # TODO remove this
53
+
48
54
  part1: str = GeneralUtilities.empty_string
49
55
  part2: str = GeneralUtilities.empty_string
50
56
  part3: str = message
@@ -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.122"
36
+ version = "3.5.124"
37
37
  __version__ = version
38
38
 
39
39
 
@@ -1543,7 +1543,7 @@ class ScriptCollectionCore:
1543
1543
  reading_stdout_last_time_resulted_in_exception = False
1544
1544
  if print_live_output:
1545
1545
  # print(out_line, end='\n', file=sys.stdout, flush=False)
1546
- log.log(out_line+"\n", LogLevel.Information)
1546
+ log.log(out_line, LogLevel.Information)
1547
1547
  # if print_live_output:
1548
1548
  # sys.stdout.flush()
1549
1549
  except Empty:
@@ -1558,7 +1558,7 @@ class ScriptCollectionCore:
1558
1558
  reading_stderr_last_time_resulted_in_exception = False
1559
1559
  if print_live_output:
1560
1560
  # print(err_line, end='\n', file=sys.stdout if print_errors_as_information else sys.stderr, flush=False)
1561
- log.log(err_line+"\n", LogLevel.Error if print_errors_as_information else LogLevel.Information)
1561
+ log.log(err_line, LogLevel.Error if print_errors_as_information else LogLevel.Information)
1562
1562
  # if print_live_output:
1563
1563
  # if print_errors_as_information:
1564
1564
  # sys.stdout.flush()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.122
3
+ Version: 3.5.124
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=ht-RZFu4g34Sr09b_L0c2QpKcjLWX-wFtKSMDMZYqsw,32266
3
- ScriptCollection/GeneralUtilities.py,sha256=j-8AgY-aK4MFgEg5vl2VcuahW-vCeHm3rcGbru117pM,47319
3
+ ScriptCollection/GeneralUtilities.py,sha256=PKdzq382RYVSWeSG_6z6FiHu-SiTOi2BavJKvP-0slU,47308
4
4
  ScriptCollection/ImageUpdater.py,sha256=lel1nevTN7fgdoCDE6Xg8YY6XPsZaOQiCIyWXbmVnh0,20882
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=6AIeza7KJ-9q13cNnbNTXgVlJqW6EAexowyni0hKTnQ,3450
10
- ScriptCollection/ScriptCollectionCore.py,sha256=LKmQ3Yh6SKW_Z_BVFICbisdEkxaPCiTLOEhDEFxk0p0,127859
9
+ ScriptCollection/SCLog.py,sha256=dfd5ulvRXVgytxUZgWOhmxPMUIUiyLknxBDaGaFJKr0,3685
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=DEyAfkveCH9lClhXeMfRqIvIwwz3IUtE980x33W4vmA,127849
11
11
  ScriptCollection/TasksForCommonProjectStructure.py,sha256=4aEuIf89jbgKE4uMYm4DlPDe9Iu1Zujo8wPOzDld09w,234867
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.122.dist-info/METADATA,sha256=k388tO8xs4bpHohNp39DFKsTYg45SaFzOzLtYrkdd6Q,7694
14
- scriptcollection-3.5.122.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
15
- scriptcollection-3.5.122.dist-info/entry_points.txt,sha256=3qMbfZEMhc_VTJj-bcLwB8AWcn9iXSB3l0AWpuu52Bs,3689
16
- scriptcollection-3.5.122.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.122.dist-info/RECORD,,
13
+ scriptcollection-3.5.124.dist-info/METADATA,sha256=kLzBhCaJrXsbJiWxY0uaxsAPjir1vQQA5oG7MVeBuJc,7694
14
+ scriptcollection-3.5.124.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
15
+ scriptcollection-3.5.124.dist-info/entry_points.txt,sha256=3qMbfZEMhc_VTJj-bcLwB8AWcn9iXSB3l0AWpuu52Bs,3689
16
+ scriptcollection-3.5.124.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.124.dist-info/RECORD,,