ScriptCollection 3.5.73__py3-none-any.whl → 3.5.75__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/Executables.py +1 -1
- ScriptCollection/GeneralUtilities.py +5 -1
- ScriptCollection/ScriptCollectionCore.py +19 -17
- ScriptCollection/TasksForCommonProjectStructure.py +2 -2
- {ScriptCollection-3.5.73.dist-info → ScriptCollection-3.5.75.dist-info}/METADATA +1 -1
- {ScriptCollection-3.5.73.dist-info → ScriptCollection-3.5.75.dist-info}/RECORD +9 -9
- {ScriptCollection-3.5.73.dist-info → ScriptCollection-3.5.75.dist-info}/WHEEL +0 -0
- {ScriptCollection-3.5.73.dist-info → ScriptCollection-3.5.75.dist-info}/entry_points.txt +0 -0
- {ScriptCollection-3.5.73.dist-info → ScriptCollection-3.5.75.dist-info}/top_level.txt +0 -0
ScriptCollection/Executables.py
CHANGED
|
@@ -535,7 +535,7 @@ def Copy() -> int:
|
|
|
535
535
|
parser.add_argument('-t', '--target', required=True)
|
|
536
536
|
args = parser.parse_args()
|
|
537
537
|
|
|
538
|
-
if
|
|
538
|
+
if os.path.isfile(args.target) or os.path.isdir(args.target):
|
|
539
539
|
raise ValueError(f"Can not copy to '{args.target}' because the target already exists.")
|
|
540
540
|
|
|
541
541
|
source=args.source
|
|
@@ -925,7 +925,7 @@ class GeneralUtilities:
|
|
|
925
925
|
|
|
926
926
|
@staticmethod
|
|
927
927
|
@check_arguments
|
|
928
|
-
def retry_action(action, amount_of_attempts: int) -> None:
|
|
928
|
+
def retry_action(action, amount_of_attempts: int,action_name:str=None) -> None:
|
|
929
929
|
amount_of_fails = 0
|
|
930
930
|
enabled = True
|
|
931
931
|
while enabled:
|
|
@@ -936,6 +936,10 @@ class GeneralUtilities:
|
|
|
936
936
|
amount_of_fails = amount_of_fails+1
|
|
937
937
|
GeneralUtilities.assert_condition(not (amount_of_attempts < amount_of_fails))
|
|
938
938
|
if amount_of_fails == amount_of_attempts:
|
|
939
|
+
message=f"Action failed {amount_of_attempts} times."
|
|
940
|
+
if action_name is not None:
|
|
941
|
+
message=f"{message} Name of action: {action_name}"
|
|
942
|
+
GeneralUtilities.write_exception_to_stderr(message)
|
|
939
943
|
raise
|
|
940
944
|
return None
|
|
941
945
|
|
|
@@ -32,7 +32,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
32
32
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
33
33
|
from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
|
|
34
34
|
|
|
35
|
-
version = "3.5.
|
|
35
|
+
version = "3.5.75"
|
|
36
36
|
__version__ = version
|
|
37
37
|
|
|
38
38
|
|
|
@@ -720,7 +720,7 @@ class ScriptCollectionCore:
|
|
|
720
720
|
def copy(self, source:str,target:str) ->None:
|
|
721
721
|
"""This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
|
|
722
722
|
if self.program_runner.will_be_executed_locally(): # works only locally, but much more performant than always running an external program
|
|
723
|
-
if
|
|
723
|
+
if os.path.isfile(target) or os.path.isdir(target):
|
|
724
724
|
raise ValueError(f"Can not copy to '{target}' because the target already exists.")
|
|
725
725
|
if os.path.isfile(source):
|
|
726
726
|
shutil.copyfile(source, target)
|
|
@@ -1344,12 +1344,6 @@ class ScriptCollectionCore:
|
|
|
1344
1344
|
|
|
1345
1345
|
@GeneralUtilities.check_arguments
|
|
1346
1346
|
def __run_program_argsasarray_async_helper(self, program: str, arguments_as_array: list[str] = [], working_directory: str = None, verbosity: int = 1, print_errors_as_information: bool = False, log_file: str = None, timeoutInSeconds: int = 600, addLogOverhead: bool = False, title: str = None, log_namespace: str = "", arguments_for_log: list[str] = None, custom_argument: object = None, interactive: bool = False) -> Popen:
|
|
1347
|
-
# Verbosity:
|
|
1348
|
-
# 0=Quiet (No output will be printed.)
|
|
1349
|
-
# 1=Normal (If the exitcode of the executed program is not 0 then the StdErr will be printed.)
|
|
1350
|
-
# 2=Full (Prints StdOut and StdErr of the executed program.)
|
|
1351
|
-
# 3=Verbose (Same as "Full" but with some more information.)
|
|
1352
|
-
|
|
1353
1347
|
if isinstance(self.program_runner, ProgramRunnerEpew):
|
|
1354
1348
|
custom_argument = CustomEpewArgument(print_errors_as_information, log_file, timeoutInSeconds, addLogOverhead, title, log_namespace, verbosity, arguments_for_log)
|
|
1355
1349
|
popen: Popen = self.program_runner.run_program_argsasarray_async_helper(program, arguments_as_array, working_directory, custom_argument, interactive)
|
|
@@ -1378,7 +1372,7 @@ class ScriptCollectionCore:
|
|
|
1378
1372
|
return False
|
|
1379
1373
|
|
|
1380
1374
|
@staticmethod
|
|
1381
|
-
def __read_popen_pipes(p: Popen) -> tuple[list[str], list[str]]:
|
|
1375
|
+
def __read_popen_pipes(p: Popen,print_live_output:bool,print_errors_as_information:bool) -> tuple[list[str], list[str]]:
|
|
1382
1376
|
p_id = p.pid
|
|
1383
1377
|
with ThreadPoolExecutor(2) as pool:
|
|
1384
1378
|
q_stdout = Queue()
|
|
@@ -1393,18 +1387,30 @@ class ScriptCollectionCore:
|
|
|
1393
1387
|
stderr_result: list[str] = []
|
|
1394
1388
|
|
|
1395
1389
|
while (ScriptCollectionCore.__continue_process_reading(p_id, p, q_stdout, q_stderr, reading_stdout_last_time_resulted_in_exception, reading_stderr_last_time_resulted_in_exception)):
|
|
1396
|
-
|
|
1397
1390
|
try:
|
|
1398
1391
|
while not q_stdout.empty():
|
|
1399
|
-
|
|
1392
|
+
out_line:str=q_stdout.get_nowait()
|
|
1393
|
+
stdout_result.append(out_line)
|
|
1400
1394
|
reading_stdout_last_time_resulted_in_exception = False
|
|
1395
|
+
if print_live_output:
|
|
1396
|
+
print(out_line, end='\n', file=sys.stdout, flush=False)
|
|
1397
|
+
if print_live_output:
|
|
1398
|
+
sys.stdout.flush()
|
|
1401
1399
|
except Empty:
|
|
1402
1400
|
reading_stdout_last_time_resulted_in_exception = True
|
|
1403
1401
|
|
|
1404
1402
|
try:
|
|
1405
1403
|
while not q_stderr.empty():
|
|
1406
|
-
|
|
1404
|
+
err_line:str=q_stderr.get_nowait()
|
|
1405
|
+
stderr_result.append(err_line)
|
|
1407
1406
|
reading_stderr_last_time_resulted_in_exception = False
|
|
1407
|
+
if print_live_output:
|
|
1408
|
+
print(err_line, end='\n', file=sys.stdout if print_errors_as_information else sys.stderr, flush=False)
|
|
1409
|
+
if print_live_output:
|
|
1410
|
+
if print_errors_as_information:
|
|
1411
|
+
sys.stdout.flush()
|
|
1412
|
+
else:
|
|
1413
|
+
sys.stderr.flush()
|
|
1408
1414
|
except Empty:
|
|
1409
1415
|
reading_stderr_last_time_resulted_in_exception = True
|
|
1410
1416
|
|
|
@@ -1452,7 +1458,7 @@ class ScriptCollectionCore:
|
|
|
1452
1458
|
GeneralUtilities.ensure_file_exists(log_file)
|
|
1453
1459
|
pid = process.pid
|
|
1454
1460
|
|
|
1455
|
-
outputs: tuple[list[str], list[str]] = ScriptCollectionCore.__read_popen_pipes(process)
|
|
1461
|
+
outputs: tuple[list[str], list[str]] = ScriptCollectionCore.__read_popen_pipes(process,print_live_output,print_errors_as_information)
|
|
1456
1462
|
|
|
1457
1463
|
for out_line_plain in outputs[0]:
|
|
1458
1464
|
if out_line_plain is not None:
|
|
@@ -1467,8 +1473,6 @@ class ScriptCollectionCore:
|
|
|
1467
1473
|
if out_line is not None and GeneralUtilities.string_has_content(out_line):
|
|
1468
1474
|
if out_line.endswith("\n"):
|
|
1469
1475
|
out_line = out_line[:-1]
|
|
1470
|
-
if print_live_output:
|
|
1471
|
-
print(out_line, end='\n', file=sys.stdout, flush=True)
|
|
1472
1476
|
if 0 < len(stdout):
|
|
1473
1477
|
stdout = stdout+"\n"
|
|
1474
1478
|
stdout = stdout+out_line
|
|
@@ -1487,8 +1491,6 @@ class ScriptCollectionCore:
|
|
|
1487
1491
|
if err_line is not None and GeneralUtilities.string_has_content(err_line):
|
|
1488
1492
|
if err_line.endswith("\n"):
|
|
1489
1493
|
err_line = err_line[:-1]
|
|
1490
|
-
if print_live_output:
|
|
1491
|
-
print(err_line, end='\n', file=sys.stdout if print_errors_as_information else sys.stderr, flush=True)
|
|
1492
1494
|
if 0 < len(stderr):
|
|
1493
1495
|
stderr = stderr+"\n"
|
|
1494
1496
|
stderr = stderr+err_line
|
|
@@ -2176,7 +2176,7 @@ class TasksForCommonProjectStructure:
|
|
|
2176
2176
|
@GeneralUtilities.check_arguments
|
|
2177
2177
|
def add_github_release(self, productname: str, projectversion: str, build_artifacts_folder: str, github_username: str, repository_folder: str, commandline_arguments: list[str]) -> None:
|
|
2178
2178
|
self.__sc.assert_is_git_repository(repository_folder)
|
|
2179
|
-
GeneralUtilities.write_message_to_stdout(f"Create GitHub-release for {productname}
|
|
2179
|
+
GeneralUtilities.write_message_to_stdout(f"Create GitHub-release for {productname}...")
|
|
2180
2180
|
verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, 1)
|
|
2181
2181
|
github_repo = f"{github_username}/{productname}"
|
|
2182
2182
|
artifact_files = []
|
|
@@ -3062,7 +3062,7 @@ class TasksForCommonProjectStructure:
|
|
|
3062
3062
|
|
|
3063
3063
|
@GeneralUtilities.check_arguments
|
|
3064
3064
|
def update_http_documentation(self, update_http_documentation_arguments: UpdateHTTPDocumentationArguments):
|
|
3065
|
-
GeneralUtilities.write_message_to_stdout(f"Update HTTP-documentation for for {update_http_documentation_arguments.product_name}
|
|
3065
|
+
GeneralUtilities.write_message_to_stdout(f"Update HTTP-documentation for for {update_http_documentation_arguments.product_name}...")
|
|
3066
3066
|
folder_of_this_file = str(os.path.dirname(update_http_documentation_arguments.current_file))
|
|
3067
3067
|
|
|
3068
3068
|
ref_repo = GeneralUtilities.resolve_relative_path(f"../../Submodules/{update_http_documentation_arguments.reference_repository_name}", folder_of_this_file)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
ScriptCollection/Executables.py,sha256=
|
|
2
|
-
ScriptCollection/GeneralUtilities.py,sha256=
|
|
1
|
+
ScriptCollection/Executables.py,sha256=zxDRhv6UHzP0F9lFQvfPv8twy27BEA0-jIMvZfcZTb4,30016
|
|
2
|
+
ScriptCollection/GeneralUtilities.py,sha256=co7hYrwTHSqSSHukkRBNSnwSRD8t237wtO2vA0YkK4E,39766
|
|
3
3
|
ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
|
|
4
4
|
ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4bQNM6RV6Y,2480
|
|
5
5
|
ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
|
|
6
6
|
ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
|
|
7
7
|
ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
|
|
8
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
9
|
-
ScriptCollection/TasksForCommonProjectStructure.py,sha256=
|
|
8
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=87yRWzemamkISYs-CW5Zs5dniulAk9A5yLtUDkLaaxg,118788
|
|
9
|
+
ScriptCollection/TasksForCommonProjectStructure.py,sha256=n3x4XRyjabsL0SuMGZz3LJiq5ctjz7mMAS77QoAJFP8,215347
|
|
10
10
|
ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
|
|
11
11
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
ScriptCollection-3.5.
|
|
13
|
-
ScriptCollection-3.5.
|
|
14
|
-
ScriptCollection-3.5.
|
|
15
|
-
ScriptCollection-3.5.
|
|
16
|
-
ScriptCollection-3.5.
|
|
12
|
+
ScriptCollection-3.5.75.dist-info/METADATA,sha256=6JiMoYzp7oM1cUYax-k5vff7q2cLW2_Xw4BeEMuvVto,7664
|
|
13
|
+
ScriptCollection-3.5.75.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
14
|
+
ScriptCollection-3.5.75.dist-info/entry_points.txt,sha256=1jAL5AuB8mvdw2v-6E7wCZFThurQxchiQynL8DCi-Yg,3545
|
|
15
|
+
ScriptCollection-3.5.75.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
16
|
+
ScriptCollection-3.5.75.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|