ScriptCollection 3.5.50__py3-none-any.whl → 3.5.53__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 +93 -0
- ScriptCollection/GeneralUtilities.py +44 -3
- ScriptCollection/ScriptCollectionCore.py +49 -9
- ScriptCollection/TasksForCommonProjectStructure.py +7 -7
- {ScriptCollection-3.5.50.dist-info → ScriptCollection-3.5.53.dist-info}/METADATA +2 -2
- ScriptCollection-3.5.53.dist-info/RECORD +16 -0
- {ScriptCollection-3.5.50.dist-info → ScriptCollection-3.5.53.dist-info}/entry_points.txt +12 -0
- ScriptCollection-3.5.50.dist-info/RECORD +0 -16
- {ScriptCollection-3.5.50.dist-info → ScriptCollection-3.5.53.dist-info}/WHEEL +0 -0
- {ScriptCollection-3.5.50.dist-info → ScriptCollection-3.5.53.dist-info}/top_level.txt +0 -0
ScriptCollection/Executables.py
CHANGED
|
@@ -387,3 +387,96 @@ def CreateChangelogEntry() -> int:
|
|
|
387
387
|
folder = GeneralUtilities.resolve_relative_path(args.repositoryfolder, os.getcwd())
|
|
388
388
|
TasksForCommonProjectStructure().create_changelog_entry(folder, args.message, args.commit)
|
|
389
389
|
return 0
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
def FileExists() -> int:
|
|
393
|
+
parser = argparse.ArgumentParser(description="This function returns 0 if the given file exists. Otherwise this function returns 2. If an error occurrs the exitcode is 1.")
|
|
394
|
+
parser.add_argument('-p', '--path', required=True)
|
|
395
|
+
args = parser.parse_args()
|
|
396
|
+
if os.path.isfile(args.path):
|
|
397
|
+
return 0
|
|
398
|
+
else:
|
|
399
|
+
return 2
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
def FolderExists() -> int:
|
|
403
|
+
parser = argparse.ArgumentParser(description="This function returns 0 if the given folder exists. Otherwise this function returns 2. If an error occurrs the exitcode is 1.")
|
|
404
|
+
parser.add_argument('-p', '--path', required=True)
|
|
405
|
+
args = parser.parse_args()
|
|
406
|
+
if os.path.isdir(args.path):
|
|
407
|
+
return 0
|
|
408
|
+
else:
|
|
409
|
+
return 2
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
def SetContentOfFile() -> int:
|
|
413
|
+
GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
|
|
414
|
+
# TODO implement function
|
|
415
|
+
return 1
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
def PrintFileContent() -> int:
|
|
419
|
+
GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
|
|
420
|
+
# TODO implement function
|
|
421
|
+
return 1
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
def CreateFile() -> int:
|
|
425
|
+
parser = argparse.ArgumentParser(description="This function creates an empty file.")
|
|
426
|
+
parser.add_argument('-p', '--path', required=True)
|
|
427
|
+
parser.add_argument('-e', '--errorwhenexists', action='store_true', required=False, default=False)
|
|
428
|
+
parser.add_argument('-c', '--createnecessaryfolder', action='store_true', required=False, default=False)
|
|
429
|
+
args = parser.parse_args()
|
|
430
|
+
sc = ScriptCollectionCore()
|
|
431
|
+
sc.create_file(args.path, args.errorwhenexists, args.createnecessaryfolder)
|
|
432
|
+
return 0
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
def CreateFolder() -> int:
|
|
436
|
+
parser = argparse.ArgumentParser(description="This function creates an empty folder.")
|
|
437
|
+
parser.add_argument('-p', '--path', required=True)
|
|
438
|
+
parser.add_argument('-e', '--errorwhenexists', action='store_true', required=False, default=False)
|
|
439
|
+
parser.add_argument('-c', '--createnecessaryfolder', action='store_true', required=False, default=False)
|
|
440
|
+
args = parser.parse_args()
|
|
441
|
+
sc = ScriptCollectionCore()
|
|
442
|
+
sc.create_folder(args.path, args.errorwhenexists, args.createnecessaryfolder)
|
|
443
|
+
return 0
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
def AppendLineToFile() -> int:
|
|
447
|
+
GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
|
|
448
|
+
# TODO implement function
|
|
449
|
+
# TODO add switch to set if adding new line at begin of line should be skipped if the file already ends with a new-line-character
|
|
450
|
+
# TODO add switch to enable/disable appending another new-line-character at the end of the file
|
|
451
|
+
return 1
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
def RegexReplaceInFile() -> int:
|
|
455
|
+
GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
|
|
456
|
+
# TODO implement function
|
|
457
|
+
return 1
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
def PrintFileSize() -> int:
|
|
461
|
+
GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
|
|
462
|
+
# TODO implement function
|
|
463
|
+
return 1
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
def FileContainsContent() -> int:
|
|
467
|
+
GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
|
|
468
|
+
# TODO implement function
|
|
469
|
+
# TODO add switch to set if the input pattern should be treated as regex
|
|
470
|
+
return 1
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
def RemoveFile() -> int:
|
|
474
|
+
GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
|
|
475
|
+
# TODO implement function
|
|
476
|
+
return 1
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
def RemoveFolder() -> int:
|
|
480
|
+
GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
|
|
481
|
+
# TODO implement function
|
|
482
|
+
return 1
|
|
@@ -5,6 +5,7 @@ import ctypes
|
|
|
5
5
|
import hashlib
|
|
6
6
|
import re
|
|
7
7
|
import os
|
|
8
|
+
import subprocess
|
|
8
9
|
import shutil
|
|
9
10
|
import urllib
|
|
10
11
|
import stat
|
|
@@ -790,8 +791,13 @@ class GeneralUtilities:
|
|
|
790
791
|
@staticmethod
|
|
791
792
|
@check_arguments
|
|
792
793
|
def epew_is_available() -> bool:
|
|
794
|
+
return GeneralUtilities.tool_is_available("epew")
|
|
795
|
+
|
|
796
|
+
@staticmethod
|
|
797
|
+
@check_arguments
|
|
798
|
+
def tool_is_available(toolname: str) -> bool:
|
|
793
799
|
try:
|
|
794
|
-
return shutil.which(
|
|
800
|
+
return shutil.which(toolname) is not None
|
|
795
801
|
except:
|
|
796
802
|
return False
|
|
797
803
|
|
|
@@ -873,7 +879,7 @@ class GeneralUtilities:
|
|
|
873
879
|
def internet_connection_is_available() -> bool:
|
|
874
880
|
# TODO add more hosts to check to return true if at least one is available
|
|
875
881
|
try:
|
|
876
|
-
with urllib.request.urlopen("https://google.com") as url_result:
|
|
882
|
+
with urllib.request.urlopen("https://www.google.com") as url_result:
|
|
877
883
|
return (url_result.code // 100) == 2
|
|
878
884
|
except:
|
|
879
885
|
pass
|
|
@@ -893,12 +899,47 @@ class GeneralUtilities:
|
|
|
893
899
|
GeneralUtilities.write_message_to_stdout(f"Result: {result}")
|
|
894
900
|
return result
|
|
895
901
|
|
|
902
|
+
@staticmethod
|
|
903
|
+
@check_arguments
|
|
904
|
+
def run_program_simple(program: str, arguments: list[str], cwd: str = None) -> tuple[int, str, str]:
|
|
905
|
+
if cwd is None:
|
|
906
|
+
cwd = os.getcwd()
|
|
907
|
+
cmd = [program]+arguments
|
|
908
|
+
with subprocess.Popen(cmd, cwd=cwd, stderr=subprocess.PIPE, stdout=subprocess.PIPE) as process:
|
|
909
|
+
stdout, stderr = process.communicate()
|
|
910
|
+
exit_code = process.wait()
|
|
911
|
+
return (exit_code, stdout, stderr)
|
|
912
|
+
|
|
913
|
+
@staticmethod
|
|
914
|
+
@check_arguments
|
|
915
|
+
def is_file(path: str) -> bool:
|
|
916
|
+
exit_code, _, stderr = GeneralUtilities.run_program_simple("scfileexists", ["--path", path])
|
|
917
|
+
if exit_code == 0:
|
|
918
|
+
return True
|
|
919
|
+
elif exit_code == 1:
|
|
920
|
+
raise ValueError(f"Not calculatable whether file '{path}' exists. StdErr: '{stderr}'")
|
|
921
|
+
elif exit_code == 2:
|
|
922
|
+
return False
|
|
923
|
+
raise ValueError(f"Fatal error occurrs while checking whether file '{path}' exists. StdErr: '{stderr}'")
|
|
924
|
+
|
|
925
|
+
@staticmethod
|
|
926
|
+
@check_arguments
|
|
927
|
+
def is_folder(path: str) -> bool:
|
|
928
|
+
exit_code, _, stderr = GeneralUtilities.run_program_simple("scfolderexists", ["--path", path])
|
|
929
|
+
if exit_code == 0:
|
|
930
|
+
return True
|
|
931
|
+
elif exit_code == 1:
|
|
932
|
+
raise ValueError(f"Not calculatable whether folder '{path}' exists. StdErr: '{stderr}'")
|
|
933
|
+
elif exit_code == 2:
|
|
934
|
+
return False
|
|
935
|
+
raise ValueError(f"Fatal error occurrs while checking whether folder '{path}' exists. StdErr: '{stderr}'")
|
|
936
|
+
|
|
896
937
|
@staticmethod
|
|
897
938
|
@check_arguments
|
|
898
939
|
def is_git_repository(folder: str) -> bool:
|
|
899
940
|
combined = os.path.join(folder, ".git")
|
|
900
941
|
# TODO consider check for bare-repositories
|
|
901
|
-
return
|
|
942
|
+
return GeneralUtilities.is_file(combined) or GeneralUtilities.is_folder(combined)
|
|
902
943
|
|
|
903
944
|
@staticmethod
|
|
904
945
|
@check_arguments
|
|
@@ -31,7 +31,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
31
31
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
32
32
|
from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
|
|
33
33
|
|
|
34
|
-
version = "3.5.
|
|
34
|
+
version = "3.5.53"
|
|
35
35
|
__version__ = version
|
|
36
36
|
|
|
37
37
|
|
|
@@ -281,7 +281,7 @@ class ScriptCollectionCore:
|
|
|
281
281
|
|
|
282
282
|
@GeneralUtilities.check_arguments
|
|
283
283
|
def git_push_with_retry(self, folder: str, remotename: str, localbranchname: str, remotebranchname: str, forcepush: bool = False, pushalltags: bool = True, verbosity: int = 0, amount_of_amounts: int = 5) -> None:
|
|
284
|
-
GeneralUtilities.retry_action(lambda
|
|
284
|
+
GeneralUtilities.retry_action(lambda: self.git_push(folder, remotename, localbranchname, remotebranchname, forcepush, pushalltags), amount_of_amounts)
|
|
285
285
|
|
|
286
286
|
@GeneralUtilities.check_arguments
|
|
287
287
|
def git_push(self, folder: str, remotename: str, localbranchname: str, remotebranchname: str, forcepush: bool = False, pushalltags: bool = True, verbosity: int = 0) -> None:
|
|
@@ -1569,7 +1569,7 @@ class ScriptCollectionCore:
|
|
|
1569
1569
|
if password is None:
|
|
1570
1570
|
password = GeneralUtilities.generate_password()
|
|
1571
1571
|
GeneralUtilities.ensure_directory_exists(folder)
|
|
1572
|
-
self.
|
|
1572
|
+
self.run_program_argsasarray("openssl", ['req', '-new', '-newkey', 'ec', '-pkeyopt', 'ec_paramgen_curve:prime256v1', '-days', str(days_until_expire), '-nodes', '-x509', '-subj', f'/C={subj_c}/ST={subj_st}/L={subj_l}/O={subj_o}/CN={name}/OU={subj_ou}', '-passout', f'pass:{password}', '-keyout', f'{name}.key', '-out', f'{name}.crt'], folder)
|
|
1573
1573
|
|
|
1574
1574
|
@GeneralUtilities.check_arguments
|
|
1575
1575
|
def generate_certificate(self, folder: str, domain: str, filename: str, subj_c: str, subj_st: str, subj_l: str, subj_o: str, subj_ou: str, days_until_expire: int = None, password: str = None) -> None:
|
|
@@ -1578,9 +1578,9 @@ class ScriptCollectionCore:
|
|
|
1578
1578
|
if password is None:
|
|
1579
1579
|
password = GeneralUtilities.generate_password()
|
|
1580
1580
|
rsa_key_length = 4096
|
|
1581
|
-
self.
|
|
1582
|
-
self.
|
|
1583
|
-
self.
|
|
1581
|
+
self.run_program_argsasarray("openssl", ['genrsa', '-out', f'{filename}.key', f'{rsa_key_length}'], folder)
|
|
1582
|
+
self.run_program_argsasarray("openssl", ['req', '-new', '-subj', f'/C={subj_c}/ST={subj_st}/L={subj_l}/O={subj_o}/CN={domain}/OU={subj_ou}', '-x509', '-key', f'{filename}.key', '-out', f'{filename}.unsigned.crt', '-days', f'{days_until_expire}'], folder)
|
|
1583
|
+
self.run_program_argsasarray("openssl", ['pkcs12', '-export', '-out', f'{filename}.selfsigned.pfx', '-password', f'pass:{password}', '-inkey', f'{filename}.key', '-in', f'{filename}.unsigned.crt'], folder)
|
|
1584
1584
|
GeneralUtilities.write_text_to_file(os.path.join(folder, f"{filename}.password"), password)
|
|
1585
1585
|
GeneralUtilities.write_text_to_file(os.path.join(folder, f"{filename}.san.conf"), f"""[ req ]
|
|
1586
1586
|
default_bits = {rsa_key_length}
|
|
@@ -1607,7 +1607,7 @@ DNS = {domain}
|
|
|
1607
1607
|
|
|
1608
1608
|
@GeneralUtilities.check_arguments
|
|
1609
1609
|
def generate_certificate_sign_request(self, folder: str, domain: str, filename: str, subj_c: str, subj_st: str, subj_l: str, subj_o: str, subj_ou: str) -> None:
|
|
1610
|
-
self.
|
|
1610
|
+
self.run_program_argsasarray("openssl", ['req', '-new', '-subj', f'/C={subj_c}/ST={subj_st}/L={subj_l}/O={subj_o}/CN={domain}/OU={subj_ou}', '-key', f'{filename}.key', f'-out', f'{filename}.csr', f'-config', f'{filename}.san.conf'], folder)
|
|
1611
1611
|
|
|
1612
1612
|
@GeneralUtilities.check_arguments
|
|
1613
1613
|
def sign_certificate(self, folder: str, ca_folder: str, ca_name: str, domain: str, filename: str, days_until_expire: int = None) -> None:
|
|
@@ -1616,8 +1616,8 @@ DNS = {domain}
|
|
|
1616
1616
|
ca = os.path.join(ca_folder, ca_name)
|
|
1617
1617
|
password_file = os.path.join(folder, f"{filename}.password")
|
|
1618
1618
|
password = GeneralUtilities.read_text_from_file(password_file)
|
|
1619
|
-
self.
|
|
1620
|
-
self.
|
|
1619
|
+
self.run_program_argsasarray("openssl", ['x509', '-req', '-in', f'{filename}.csr', '-CA', f'{ca}.crt', '-CAkey', f'{ca}.key', '-CAcreateserial', '-CAserial', f'{ca}.srl', '-out', f'{filename}.crt', '-days', str(days_until_expire), '-sha256', '-extensions', 'v3_req', '-extfile', f'{filename}.san.conf'], folder)
|
|
1620
|
+
self.run_program_argsasarray("openssl", ['pkcs12', '-export', '-out', f'{filename}.pfx', f'-inkey', f'{filename}.key', '-in', f'{filename}.crt', '-password', f'pass:{password}'], folder)
|
|
1621
1621
|
|
|
1622
1622
|
@GeneralUtilities.check_arguments
|
|
1623
1623
|
def update_dependencies_of_python_in_requirementstxt_file(self, file: str, verbosity: int):
|
|
@@ -1984,3 +1984,43 @@ TXDX
|
|
|
1984
1984
|
@GeneralUtilities.check_arguments
|
|
1985
1985
|
def create_local_docker_network(self, network_name: str) -> None:
|
|
1986
1986
|
self.run_program("docker", f"network create {network_name}")
|
|
1987
|
+
|
|
1988
|
+
@GeneralUtilities.check_arguments
|
|
1989
|
+
def create_file(self, path: str, error_if_already_exists: bool, create_necessary_folder: bool) -> None:
|
|
1990
|
+
if not os.path.isabs(path):
|
|
1991
|
+
path = os.path.join(os.getcwd(), path)
|
|
1992
|
+
|
|
1993
|
+
if os.path.isfile(path) and error_if_already_exists:
|
|
1994
|
+
raise ValueError(f"File '{path}' already exists.")
|
|
1995
|
+
|
|
1996
|
+
# TODO maybe it should be checked if there is a folder with the same path which already exists.
|
|
1997
|
+
|
|
1998
|
+
folder = os.path.dirname(path)
|
|
1999
|
+
|
|
2000
|
+
if not os.path.isdir(folder):
|
|
2001
|
+
if create_necessary_folder:
|
|
2002
|
+
GeneralUtilities.ensure_directory_exists(folder) # TODO check if this also create nested folders if required
|
|
2003
|
+
else:
|
|
2004
|
+
raise ValueError(f"Folder '{folder}' does not exist.")
|
|
2005
|
+
|
|
2006
|
+
GeneralUtilities.ensure_file_exists(path)
|
|
2007
|
+
|
|
2008
|
+
@GeneralUtilities.check_arguments
|
|
2009
|
+
def create_folder(self, path: str, error_if_already_exists: bool, create_necessary_folder: bool) -> None:
|
|
2010
|
+
if not os.path.isabs(path):
|
|
2011
|
+
path = os.path.join(os.getcwd(), path)
|
|
2012
|
+
|
|
2013
|
+
if os.path.isdir(path) and error_if_already_exists:
|
|
2014
|
+
raise ValueError(f"Folder '{path}' already exists.")
|
|
2015
|
+
|
|
2016
|
+
# TODO maybe it should be checked if there is a file with the same path which already exists.
|
|
2017
|
+
|
|
2018
|
+
folder = os.path.dirname(path)
|
|
2019
|
+
|
|
2020
|
+
if not os.path.isdir(folder):
|
|
2021
|
+
if create_necessary_folder:
|
|
2022
|
+
GeneralUtilities.ensure_directory_exists(folder) # TODO check if this also create nested folders if required
|
|
2023
|
+
else:
|
|
2024
|
+
raise ValueError(f"Folder '{folder}' does not exist.")
|
|
2025
|
+
|
|
2026
|
+
GeneralUtilities.ensure_directory_exists(path)
|
|
@@ -468,8 +468,8 @@ class TasksForCommonProjectStructure:
|
|
|
468
468
|
for search_result in Path(codeunit_folder).glob('**/*.tt'):
|
|
469
469
|
tt_file = str(search_result)
|
|
470
470
|
relative_path_to_tt_file = str(Path(tt_file).relative_to(codeunit_folder))
|
|
471
|
-
argument = f"--parameter=repositoryFolder={repository_folder} --parameter=codeUnitName={codeunitname}
|
|
472
|
-
sc.
|
|
471
|
+
argument = [f"--parameter=repositoryFolder={repository_folder}", f"--parameter=codeUnitName={codeunitname}", relative_path_to_tt_file]
|
|
472
|
+
sc.run_program_argsasarray("t4", argument, codeunit_folder, verbosity=verbosity)
|
|
473
473
|
|
|
474
474
|
@GeneralUtilities.check_arguments
|
|
475
475
|
def standardized_tasks_generate_reference_by_docfx(self, generate_reference_script_file: str, verbosity: int, targetenvironmenttype: str, commandline_arguments: list[str]) -> None:
|
|
@@ -667,7 +667,7 @@ class TasksForCommonProjectStructure:
|
|
|
667
667
|
self.__sc.run_program("dotnet", "clean", csproj_file_folder, verbosity=verbosity)
|
|
668
668
|
GeneralUtilities.ensure_directory_exists(outputfolder)
|
|
669
669
|
self.__sc.run_program("dotnet", "restore", codeunit_folder, verbosity=verbosity)
|
|
670
|
-
self.__sc.
|
|
670
|
+
self.__sc.run_program_argsasarray("dotnet", ["build", csproj_file_name, "-c", dotnet_build_configuration, "-o", outputfolder, "--runtime", runtime], csproj_file_folder, verbosity=verbosity)
|
|
671
671
|
if copy_license_file_to_target_folder:
|
|
672
672
|
license_file = os.path.join(repository_folder, "License.txt")
|
|
673
673
|
target = os.path.join(outputfolder, f"{codeunit_name}.License.txt")
|
|
@@ -679,7 +679,7 @@ class TasksForCommonProjectStructure:
|
|
|
679
679
|
dll_file_full = os.path.join(outputfolder, dll_file)
|
|
680
680
|
if os.path.isfile(dll_file_full):
|
|
681
681
|
GeneralUtilities.assert_condition(self.__sc.run_program("sn", f"-vf {dll_file}", outputfolder, throw_exception_if_exitcode_is_not_zero=False)[0] == 1, f"Pre-verifying of {dll_file} failed.")
|
|
682
|
-
self.__sc.
|
|
682
|
+
self.__sc.run_program_argsasarray("sn", ["-R", dll_file, snk_file], outputfolder)
|
|
683
683
|
GeneralUtilities.assert_condition(self.__sc.run_program("sn", f"-vf {dll_file}", outputfolder, throw_exception_if_exitcode_is_not_zero=False)[0] == 0, f"Verifying of {dll_file} failed.")
|
|
684
684
|
sarif_filename = f"{csproj_file_name_without_extension}.sarif"
|
|
685
685
|
sarif_source_file = os.path.join(sarif_folder, sarif_filename)
|
|
@@ -757,7 +757,7 @@ class TasksForCommonProjectStructure:
|
|
|
757
757
|
sc = ScriptCollectionCore()
|
|
758
758
|
bomfile_folder = "Other\\Artifacts\\BOM"
|
|
759
759
|
verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, verbosity)
|
|
760
|
-
sc.
|
|
760
|
+
sc.run_program_argsasarray("dotnet", ["CycloneDX", f"{codeunit_name}\\{codeunit_name}.csproj", "-o", bomfile_folder, "--disable-github-licenses"], codeunit_folder, verbosity=verbosity)
|
|
761
761
|
codeunitversion = self.get_version_of_codeunit(os.path.join(codeunit_folder, f"{codeunit_name}.codeunit.xml"))
|
|
762
762
|
target = f"{codeunit_folder}\\{bomfile_folder}\\{codeunit_name}.{codeunitversion}.sbom.xml"
|
|
763
763
|
GeneralUtilities.ensure_file_does_not_exist(target)
|
|
@@ -1662,8 +1662,8 @@ class TasksForCommonProjectStructure:
|
|
|
1662
1662
|
try:
|
|
1663
1663
|
GeneralUtilities.ensure_file_does_not_exist(temp_file)
|
|
1664
1664
|
GeneralUtilities.write_text_to_file(temp_file, self.__sc.run_program("git", f'--no-pager diff --src-prefix={src_prefix}/ --dst-prefix={dst_prefix}/ {src} {dst} -- {codeunit_name}', repository_folder)[1])
|
|
1665
|
-
self.__sc.
|
|
1666
|
-
self.__sc.
|
|
1665
|
+
self.__sc.run_program_argsasarray("pygmentize", ['-l', 'diff', '-f', 'html', '-O', 'full', '-o', target_file_light, '-P', 'style=default', temp_file], repository_folder)
|
|
1666
|
+
self.__sc.run_program_argsasarray("pygmentize", ['-l', 'diff', '-f', 'html', '-O', 'full', '-o', target_file_dark, '-P', 'style=github-dark', temp_file], repository_folder)
|
|
1667
1667
|
finally:
|
|
1668
1668
|
GeneralUtilities.ensure_file_does_not_exist(temp_file)
|
|
1669
1669
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: ScriptCollection
|
|
3
|
-
Version: 3.5.
|
|
3
|
+
Version: 3.5.53
|
|
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
|
|
@@ -33,7 +33,7 @@ Requires-Dist: ntplib>=0.4.0
|
|
|
33
33
|
Requires-Dist: Pillow>=11.1.0
|
|
34
34
|
Requires-Dist: pycdlib>=1.14.0
|
|
35
35
|
Requires-Dist: Pygments>=2.19.1
|
|
36
|
-
Requires-Dist: pylint>=3.3.
|
|
36
|
+
Requires-Dist: pylint>=3.3.4
|
|
37
37
|
Requires-Dist: pyOpenSSL>=25.0.0
|
|
38
38
|
Requires-Dist: PyPDF2>=3.0.1
|
|
39
39
|
Requires-Dist: pytest>=8.3.4
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
ScriptCollection/Executables.py,sha256=YMPkCwR4xfurYWQ2l2WcipO0hMNO2VB9ygKZsAvk5wc,24273
|
|
2
|
+
ScriptCollection/GeneralUtilities.py,sha256=TBhTAMshqBbwF7WZhDv3FDfCyiNWCgiqQnXogWo0U20,40190
|
|
3
|
+
ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
|
|
4
|
+
ScriptCollection/ProgramRunnerBase.py,sha256=7QAjoqOz6XPmJH19F2k-Z1fFQB_uZnPFvn-T54IJcHQ,2324
|
|
5
|
+
ScriptCollection/ProgramRunnerEpew.py,sha256=C2Rs3YWOWWWJct7XmKphp5CF1tf0j4Fp-ljV2drLTfs,6349
|
|
6
|
+
ScriptCollection/ProgramRunnerPopen.py,sha256=UGWUK0345DmtnD1gsKa1B3tBLDzKKXUGnSbIuCSWzLU,3714
|
|
7
|
+
ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
|
|
8
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=MBfnCOjjAEKrp5EUCzHKmL5n2GslR5md711hgc1Q0uo,109174
|
|
9
|
+
ScriptCollection/TasksForCommonProjectStructure.py,sha256=mmGkHrWicj6Yv_FH3eBnhj_ezwqws8noQq4L3yTQW0s,214149
|
|
10
|
+
ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
|
|
11
|
+
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
ScriptCollection-3.5.53.dist-info/METADATA,sha256=VzXKNwWcSY8BlqFac01axFr28kkhkyjHsXeXRHF2KCs,7665
|
|
13
|
+
ScriptCollection-3.5.53.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
14
|
+
ScriptCollection-3.5.53.dist-info/entry_points.txt,sha256=FQ6G7VA5YX6TmEqcZD8BA-2dYRAw8Y4C5Ckl1QET95c,3145
|
|
15
|
+
ScriptCollection-3.5.53.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
16
|
+
ScriptCollection-3.5.53.dist-info/RECORD,,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
[console_scripts]
|
|
2
|
+
scappendlinetofile = ScriptCollection.Executables:AppendLineToFile
|
|
2
3
|
scbuildcodeunit = ScriptCollection.Executables:BuildCodeUnit
|
|
3
4
|
scbuildcodeunits = ScriptCollection.Executables:BuildCodeUnits
|
|
4
5
|
scbuildcodeunitsc = ScriptCollection.Executables:BuildCodeUnitsC
|
|
@@ -7,11 +8,16 @@ scchangefileextension = ScriptCollection.Executables:ChangeFileExtensions
|
|
|
7
8
|
scchangehashofprogram = ScriptCollection.Executables:ChangeHashOfProgram
|
|
8
9
|
sccreatechangelogentry = ScriptCollection.Executables:CreateChangelogEntry
|
|
9
10
|
sccreateemptyfilewithspecificsize = ScriptCollection.Executables:CreateEmptyFileWithSpecificSize
|
|
11
|
+
sccreatefile = ScriptCollection.Executables:CreateFile
|
|
12
|
+
sccreatefolder = ScriptCollection.Executables:CreateFolder
|
|
10
13
|
sccreatehashofallfiles = ScriptCollection.Executables:CreateHashOfAllFiles
|
|
11
14
|
sccreateisofilewithobfuscatedfiles = ScriptCollection.Executables:CreateISOFileWithObfuscatedFiles
|
|
12
15
|
sccreatesimplemergewithoutrelease = ScriptCollection.Executables:CreateSimpleMergeWithoutRelease
|
|
13
16
|
scextractpdfpages = ScriptCollection.Executables:ExtractPDFPages
|
|
17
|
+
scfilecontainscontent = ScriptCollection.Executables:FileContainsContent
|
|
18
|
+
scfileexists = ScriptCollection.Executables:FileExists
|
|
14
19
|
scfilenameobfuscator = ScriptCollection.Executables:FilenameObfuscator
|
|
20
|
+
scfolderexists = ScriptCollection.Executables:FolderExists
|
|
15
21
|
scgeneratearc42referencetemplate = ScriptCollection.Executables:GenerateARC42ReferenceTemplate
|
|
16
22
|
scgeneratecertificate = ScriptCollection.Executables:GenerateCertificate
|
|
17
23
|
scgeneratecertificateauthority = ScriptCollection.Executables:GenerateCertificateAuthority
|
|
@@ -24,8 +30,14 @@ scmergepdfs = ScriptCollection.Executables:MergePDFs
|
|
|
24
30
|
scobfuscatefilesfolder = ScriptCollection.Executables:ObfuscateFilesFolder
|
|
25
31
|
scorganizelinesinfile = ScriptCollection.Executables:OrganizeLinesInFile
|
|
26
32
|
scpdftoimage = ScriptCollection.Executables:PDFToImage
|
|
33
|
+
scprintfilecontent = ScriptCollection.Executables:PrintFileContent
|
|
34
|
+
scprintfilesize = ScriptCollection.Executables:PrintFileSize
|
|
35
|
+
scregexreplaceinfile = ScriptCollection.Executables:RegexReplaceInFile
|
|
36
|
+
scremoveFolder = ScriptCollection.Executables:RemoveFolder
|
|
37
|
+
scremovefile = ScriptCollection.Executables:RemoveFile
|
|
27
38
|
screplacesubstringsinfilenames = ScriptCollection.Executables:ReplaceSubstringsInFilenames
|
|
28
39
|
scsearchinfiles = ScriptCollection.Executables:SearchInFiles
|
|
40
|
+
scsetcontentoffile = ScriptCollection.Executables:SetContentOfFile
|
|
29
41
|
scshow2faasqrcode = ScriptCollection.Executables:Show2FAAsQRCode
|
|
30
42
|
scshowmissingfiles = ScriptCollection.Executables:ShowMissingFiles
|
|
31
43
|
scsigncertificate = ScriptCollection.Executables:SignCertificate
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
ScriptCollection/Executables.py,sha256=ls3wGZpt48YwwtO0QGWWyIImSE87SyzbL-WxhpwQJug,20837
|
|
2
|
-
ScriptCollection/GeneralUtilities.py,sha256=PTe5Uz3leVoAO8Ncz5HZr_GhwZYA9XxBxIVfqPspc2s,38426
|
|
3
|
-
ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
|
|
4
|
-
ScriptCollection/ProgramRunnerBase.py,sha256=7QAjoqOz6XPmJH19F2k-Z1fFQB_uZnPFvn-T54IJcHQ,2324
|
|
5
|
-
ScriptCollection/ProgramRunnerEpew.py,sha256=C2Rs3YWOWWWJct7XmKphp5CF1tf0j4Fp-ljV2drLTfs,6349
|
|
6
|
-
ScriptCollection/ProgramRunnerPopen.py,sha256=UGWUK0345DmtnD1gsKa1B3tBLDzKKXUGnSbIuCSWzLU,3714
|
|
7
|
-
ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
|
|
8
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=fCnZU8WNoNUP7dO_bA1Rg_zLlwdVM90jpNlzolntSWk,107119
|
|
9
|
-
ScriptCollection/TasksForCommonProjectStructure.py,sha256=LZszSMaMQ9xQe6HeTg_-AHYKSihBYkBeGNZyb4hUEqM,214011
|
|
10
|
-
ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
|
|
11
|
-
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
ScriptCollection-3.5.50.dist-info/METADATA,sha256=ezYo1miMbgGjEP4CA2_fFOvj0dNaVmYo9I7hrQBbMwM,7665
|
|
13
|
-
ScriptCollection-3.5.50.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
14
|
-
ScriptCollection-3.5.50.dist-info/entry_points.txt,sha256=_O7BmQ81LdDfrj5uOhjshg9Xc-tABHQJIxDOyOGRzzI,2397
|
|
15
|
-
ScriptCollection-3.5.50.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
16
|
-
ScriptCollection-3.5.50.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|