ScriptCollection 4.2.133__py3-none-any.whl → 4.2.135__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 +196 -40
- ScriptCollection/GeneralUtilities.py +17 -7
- ScriptCollection/Resources/Dependencies/OpenAPIGenerator/Version.txt +1 -0
- ScriptCollection/SCLog.py +0 -3
- ScriptCollection/ScriptCollectionCore.py +52 -3
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py +1 -1
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +34 -6
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.135.dist-info}/METADATA +10 -10
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.135.dist-info}/RECORD +12 -11
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.135.dist-info}/entry_points.txt +2 -0
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.135.dist-info}/WHEEL +0 -0
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.135.dist-info}/top_level.txt +0 -0
ScriptCollection/Executables.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import base64
|
|
2
2
|
import os
|
|
3
|
+
import re
|
|
4
|
+
import subprocess
|
|
5
|
+
import fnmatch
|
|
3
6
|
import argparse
|
|
4
7
|
import time
|
|
5
8
|
import traceback
|
|
@@ -429,18 +432,23 @@ def FolderExists() -> int:
|
|
|
429
432
|
|
|
430
433
|
|
|
431
434
|
def PrintFileContent() -> int:
|
|
432
|
-
parser = argparse.ArgumentParser(description="This function prints the
|
|
435
|
+
parser = argparse.ArgumentParser(description="This function prints the content of a file. With --excludedfolder you can forbid reading files inside certain folders even though reading is allowed in general.")
|
|
433
436
|
parser.add_argument('-p', '--path', required=True)
|
|
434
437
|
parser.add_argument('-e', '--encoding', required=False, default="utf-8")
|
|
438
|
+
parser.add_argument('-b', '--basefolder', required=False, default=".", help="Base-folder the excludedfolder-entries are relative to. Defaults to the current working-directory.")
|
|
439
|
+
parser.add_argument('-x', '--excludedfolder', action='append', default=[], help="A folder (relative to basefolder) whose files must not be read. Can be specified multiple times. Example: --excludedfolder .git --excludedfolder .claude --excludedfolder Other/Secrets")
|
|
435
440
|
args = parser.parse_args()
|
|
436
441
|
file = args.path
|
|
437
442
|
encoding = args.encoding
|
|
438
|
-
if os.path.isfile(file):
|
|
439
|
-
GeneralUtilities.write_message_to_stdout(GeneralUtilities.read_text_from_file(file, encoding))
|
|
440
|
-
return 0
|
|
441
|
-
else:
|
|
443
|
+
if not os.path.isfile(file):
|
|
442
444
|
GeneralUtilities.write_exception_to_stderr(f"File '{file}' does not exist.")
|
|
443
445
|
return 1
|
|
446
|
+
sc = ScriptCollectionCore()
|
|
447
|
+
if sc.path_is_inside_one_of_the_folders(file, args.basefolder, args.excludedfolder):
|
|
448
|
+
GeneralUtilities.write_message_to_stderr(f"Reading '{file}' is not allowed because it is located inside an excluded folder.")
|
|
449
|
+
return 1
|
|
450
|
+
GeneralUtilities.write_message_to_stdout(GeneralUtilities.read_text_from_file(file, encoding))
|
|
451
|
+
return 0
|
|
444
452
|
|
|
445
453
|
|
|
446
454
|
def CreateFile() -> int:
|
|
@@ -466,17 +474,52 @@ def CreateFolder() -> int:
|
|
|
466
474
|
|
|
467
475
|
|
|
468
476
|
def AppendLineToFile() -> int:
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
477
|
+
parser = argparse.ArgumentParser(description="Appends a line to a file. By default a leading newline is inserted before the line and a trailing newline after it (POSIX-line-ended files).")
|
|
478
|
+
parser.add_argument('-p', '--path', required=True)
|
|
479
|
+
parser.add_argument('-l', '--line', required=True, help='Line content to append (without trailing newline).')
|
|
480
|
+
parser.add_argument('-e', '--encoding', default="utf-8")
|
|
481
|
+
parser.add_argument('--skip-leading-newline-if-file-already-ends-with-newline', action='store_true', default=False, help='If the file already ends with a newline character, do not insert another leading newline (avoids an empty line).')
|
|
482
|
+
parser.add_argument('--no-trailing-newline', action='store_true', default=False, help='Do not append a trailing newline character after the line.')
|
|
483
|
+
args = parser.parse_args()
|
|
484
|
+
if not os.path.isfile(args.path):
|
|
485
|
+
GeneralUtilities.write_message_to_stderr(f"File '{args.path}' does not exist.")
|
|
486
|
+
return 1
|
|
487
|
+
existing = GeneralUtilities.read_text_from_file(args.path, args.encoding)
|
|
488
|
+
if not existing:
|
|
489
|
+
prefix = ""
|
|
490
|
+
elif existing.endswith("\n") and args.skip_leading_newline_if_file_already_ends_with_newline:
|
|
491
|
+
prefix = ""
|
|
492
|
+
else:
|
|
493
|
+
prefix = "\n"
|
|
494
|
+
suffix = "" if args.no_trailing_newline else "\n"
|
|
495
|
+
GeneralUtilities.write_text_to_file(args.path, existing + prefix + args.line + suffix, args.encoding)
|
|
496
|
+
return 0
|
|
474
497
|
|
|
475
498
|
|
|
476
499
|
def RegexReplaceInFile() -> int:
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
500
|
+
parser = argparse.ArgumentParser(description="Performs a regex-based replacement in a file and writes the result back. Supports backreferences (e.g. \\1) in the replacement string.")
|
|
501
|
+
parser.add_argument('-p', '--path', required=True)
|
|
502
|
+
parser.add_argument('-r', '--pattern', required=True, help='Regular expression to match.')
|
|
503
|
+
parser.add_argument('-w', '--replacement', required=True, help='Replacement string (supports backreferences such as \\1).')
|
|
504
|
+
parser.add_argument('-e', '--encoding', default="utf-8")
|
|
505
|
+
parser.add_argument('-i', '--case-insensitive', action='store_true', default=False)
|
|
506
|
+
parser.add_argument('-m', '--multiline', action='store_true', default=False, help='Enable re.MULTILINE (^ and $ match at line boundaries).')
|
|
507
|
+
parser.add_argument('-d', '--dotall', action='store_true', default=False, help='Enable re.DOTALL (. matches newlines).')
|
|
508
|
+
args = parser.parse_args()
|
|
509
|
+
if not os.path.isfile(args.path):
|
|
510
|
+
GeneralUtilities.write_message_to_stderr(f"File '{args.path}' does not exist.")
|
|
511
|
+
return 1
|
|
512
|
+
flags = 0
|
|
513
|
+
if args.case_insensitive:
|
|
514
|
+
flags |= re.IGNORECASE
|
|
515
|
+
if args.multiline:
|
|
516
|
+
flags |= re.MULTILINE
|
|
517
|
+
if args.dotall:
|
|
518
|
+
flags |= re.DOTALL
|
|
519
|
+
content = GeneralUtilities.read_text_from_file(args.path, args.encoding)
|
|
520
|
+
new_content = re.sub(args.pattern, args.replacement, content, flags=flags)
|
|
521
|
+
GeneralUtilities.write_text_to_file(args.path, new_content, args.encoding)
|
|
522
|
+
return 0
|
|
480
523
|
|
|
481
524
|
|
|
482
525
|
def PrintFileSize() -> int:
|
|
@@ -494,10 +537,19 @@ def PrintFileSize() -> int:
|
|
|
494
537
|
|
|
495
538
|
|
|
496
539
|
def FileContainsContent() -> int:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
540
|
+
parser = argparse.ArgumentParser(description="Returns exit-code 0 if the file contains the given content, 2 if not. 1 on error (e.g. file does not exist).")
|
|
541
|
+
parser.add_argument('-p', '--path', required=True)
|
|
542
|
+
parser.add_argument('-c', '--content', required=True, help='Substring (or regex if --regex is set) to search for.')
|
|
543
|
+
parser.add_argument('-r', '--regex', action='store_true', default=False, help='Treat --content as a regular expression.')
|
|
544
|
+
parser.add_argument('-i', '--case-insensitive', action='store_true', default=False, help='Match case-insensitively.')
|
|
545
|
+
parser.add_argument('-e', '--encoding', default="utf-8")
|
|
546
|
+
args = parser.parse_args()
|
|
547
|
+
if not os.path.isfile(args.path):
|
|
548
|
+
GeneralUtilities.write_message_to_stderr(f"File '{args.path}' does not exist.")
|
|
549
|
+
return 1
|
|
550
|
+
sc = ScriptCollectionCore()
|
|
551
|
+
found = sc.file_contains_content(args.path, args.content, args.regex, not args.case_insensitive, args.encoding)
|
|
552
|
+
return 0 if found else 2
|
|
501
553
|
|
|
502
554
|
|
|
503
555
|
def RemoveFile() -> int:
|
|
@@ -602,31 +654,116 @@ def ListFolderContent() -> int:
|
|
|
602
654
|
parser.add_argument('-f', '--excludefiles', action='store_true', required=False, default=False)
|
|
603
655
|
parser.add_argument('-d', '--excludedirectories', action='store_true', required=False, default=False)
|
|
604
656
|
parser.add_argument('-n', '--printonlynamewithoutpath', action='store_true', required=False, default=False)
|
|
605
|
-
|
|
606
|
-
|
|
657
|
+
parser.add_argument('-t', '--transitive', action='store_true', required=False, default=False, help='Recurse into subfolders.')
|
|
658
|
+
filter_group = parser.add_mutually_exclusive_group()
|
|
659
|
+
filter_group.add_argument('--extension', help='Comma-separated list of file extensions (without dot) to include, e.g. "py,md".')
|
|
660
|
+
filter_group.add_argument('--glob', help='Glob pattern matched against entry basename, e.g. "*.py" or "test_*".')
|
|
661
|
+
filter_group.add_argument('--regex', help='Regex pattern matched against entry basename.')
|
|
607
662
|
args = parser.parse_args()
|
|
608
663
|
folder = args.path
|
|
609
664
|
if not os.path.isabs(folder):
|
|
610
665
|
folder = GeneralUtilities.resolve_relative_path(folder, os.getcwd())
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
if
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
666
|
+
if not os.path.isdir(folder):
|
|
667
|
+
GeneralUtilities.write_message_to_stderr(f"Folder '{folder}' does not exist.")
|
|
668
|
+
return 1
|
|
669
|
+
if args.excludefiles and args.excludedirectories:
|
|
670
|
+
GeneralUtilities.write_message_to_stderr("Nothing to list: both files and folders are excluded.")
|
|
671
|
+
return 1
|
|
672
|
+
extensions: set[str] = None
|
|
673
|
+
if args.extension is not None:
|
|
674
|
+
extensions = {e.strip().lower().lstrip(".") for e in args.extension.split(",") if e.strip()}
|
|
675
|
+
|
|
676
|
+
def matches_filter(entry_path: str) -> bool:
|
|
677
|
+
basename = os.path.basename(entry_path)
|
|
678
|
+
if extensions is not None:
|
|
679
|
+
ext = os.path.splitext(basename)[1].lstrip(".").lower()
|
|
680
|
+
return ext in extensions
|
|
681
|
+
if args.glob is not None:
|
|
682
|
+
return fnmatch.fnmatch(basename, args.glob)
|
|
683
|
+
if args.regex is not None:
|
|
684
|
+
return re.search(args.regex, basename) is not None
|
|
685
|
+
return True
|
|
686
|
+
|
|
687
|
+
entries: list[str] = []
|
|
688
|
+
if args.transitive:
|
|
689
|
+
for current_root, subfolders, files in os.walk(folder):
|
|
690
|
+
if not args.excludedirectories:
|
|
691
|
+
for subfolder in subfolders:
|
|
692
|
+
entries.append(os.path.join(current_root, subfolder))
|
|
693
|
+
if not args.excludefiles:
|
|
694
|
+
for file in files:
|
|
695
|
+
entries.append(os.path.join(current_root, file))
|
|
696
|
+
else:
|
|
697
|
+
if not args.excludefiles:
|
|
698
|
+
entries = entries + GeneralUtilities.get_direct_files_of_folder(folder)
|
|
699
|
+
if not args.excludedirectories:
|
|
700
|
+
entries = entries + GeneralUtilities.get_direct_folders_of_folder(folder)
|
|
701
|
+
|
|
702
|
+
for entry in entries:
|
|
703
|
+
if not matches_filter(entry):
|
|
704
|
+
continue
|
|
705
|
+
content_to_print = os.path.basename(entry) if args.printonlynamewithoutpath else entry
|
|
622
706
|
GeneralUtilities.write_message_to_stdout(content_to_print)
|
|
623
707
|
return 0
|
|
624
708
|
|
|
625
709
|
|
|
626
710
|
def ForEach() -> int:
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
711
|
+
parser = argparse.ArgumentParser(
|
|
712
|
+
description=(
|
|
713
|
+
"Iterates the entries of a folder and runs a command for each one. The placeholder '{path}' "
|
|
714
|
+
"in the command template is replaced with the entry's absolute path before execution. "
|
|
715
|
+
"By default only direct child entries are processed; with --transitive the whole subtree is walked. "
|
|
716
|
+
"By default only files are processed; use --include-folders to also process folders.\n"
|
|
717
|
+
"\n"
|
|
718
|
+
"Example: scforeach -f . -c \"git -C \\\"{path}\\\" status -s\" --include-folders --skip-files"
|
|
719
|
+
),
|
|
720
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
721
|
+
)
|
|
722
|
+
parser.add_argument('-f', '--folder', required=True, help='Folder whose entries should be iterated.')
|
|
723
|
+
parser.add_argument('-c', '--command', required=True, help='Command template. Use "{path}" as placeholder for the entry path.')
|
|
724
|
+
parser.add_argument('-t', '--transitive', action='store_true', default=False, help='Recurse into subfolders.')
|
|
725
|
+
parser.add_argument('--include-folders', action='store_true', default=False, help='Also process folder entries (default: only files).')
|
|
726
|
+
parser.add_argument('--skip-files', action='store_true', default=False, help='Skip file entries (useful in combination with --include-folders).')
|
|
727
|
+
parser.add_argument('--continue-on-error', action='store_true', default=False, help='Continue with the next entry even if a command returns a non-zero exit-code.')
|
|
728
|
+
args = parser.parse_args()
|
|
729
|
+
if not os.path.isdir(args.folder):
|
|
730
|
+
GeneralUtilities.write_message_to_stderr(f"Folder '{args.folder}' does not exist.")
|
|
731
|
+
return 1
|
|
732
|
+
process_files = not args.skip_files
|
|
733
|
+
process_folders = args.include_folders
|
|
734
|
+
if not process_files and not process_folders:
|
|
735
|
+
GeneralUtilities.write_message_to_stderr("Nothing to do: both files and folders are excluded.")
|
|
736
|
+
return 1
|
|
737
|
+
entries: list[str] = []
|
|
738
|
+
if args.transitive:
|
|
739
|
+
for current_root, subfolders, files in os.walk(args.folder):
|
|
740
|
+
if process_folders:
|
|
741
|
+
for subfolder in subfolders:
|
|
742
|
+
entries.append(os.path.join(current_root, subfolder))
|
|
743
|
+
if process_files:
|
|
744
|
+
for file in files:
|
|
745
|
+
entries.append(os.path.join(current_root, file))
|
|
746
|
+
else:
|
|
747
|
+
for entry_name in os.listdir(args.folder):
|
|
748
|
+
entry_path = os.path.join(args.folder, entry_name)
|
|
749
|
+
if os.path.isfile(entry_path) and process_files:
|
|
750
|
+
entries.append(entry_path)
|
|
751
|
+
elif os.path.isdir(entry_path) and process_folders:
|
|
752
|
+
entries.append(entry_path)
|
|
753
|
+
aggregate_exit_code = 0
|
|
754
|
+
for entry_path in entries:
|
|
755
|
+
absolute_entry_path = os.path.abspath(entry_path)
|
|
756
|
+
rendered_command = args.command.replace("{path}", absolute_entry_path)
|
|
757
|
+
completed = subprocess.run(rendered_command, shell=True, capture_output=True, text=True, check=False)
|
|
758
|
+
if completed.stdout:
|
|
759
|
+
GeneralUtilities.write_message_to_stdout(completed.stdout.rstrip("\n"))
|
|
760
|
+
if completed.stderr:
|
|
761
|
+
GeneralUtilities.write_message_to_stderr(completed.stderr.rstrip("\n"))
|
|
762
|
+
if completed.returncode != 0:
|
|
763
|
+
aggregate_exit_code = completed.returncode
|
|
764
|
+
if not args.continue_on_error:
|
|
765
|
+
return aggregate_exit_code
|
|
766
|
+
return aggregate_exit_code
|
|
630
767
|
|
|
631
768
|
|
|
632
769
|
def NpmI() -> int:
|
|
@@ -798,13 +935,19 @@ def SetFileContent() -> int:
|
|
|
798
935
|
|
|
799
936
|
|
|
800
937
|
def GenerateTaskfileFromWorkspacefile() -> int:
|
|
801
|
-
parser = argparse.ArgumentParser(description="Generates a
|
|
802
|
-
parser.add_argument('-f', '--repositoryfolder', required=True)
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
938
|
+
parser = argparse.ArgumentParser(description="Generates a Taskfile.yml file from a .code-workspace file.")
|
|
939
|
+
parser.add_argument('-f', '--repositoryfolder', required=True, help='Repository folder containing the .code-workspace file.')
|
|
940
|
+
parser.add_argument('--appendcliargs', action='store_true', default=False, help='Append "{{.CLI_ARGS}}" to each generated task command so extra CLI-args can be forwarded.')
|
|
941
|
+
args = parser.parse_args()
|
|
942
|
+
repository_folder = args.repositoryfolder
|
|
943
|
+
if not os.path.isabs(repository_folder):
|
|
944
|
+
repository_folder = GeneralUtilities.resolve_relative_path(repository_folder, os.getcwd())
|
|
945
|
+
if not os.path.isdir(repository_folder):
|
|
946
|
+
GeneralUtilities.write_message_to_stderr(f"Folder '{repository_folder}' does not exist.")
|
|
947
|
+
return 1
|
|
948
|
+
sc = ScriptCollectionCore()
|
|
949
|
+
TFCPS_Tools_General(sc).generate_tasksfile_from_workspace_file(repository_folder, args.appendcliargs)
|
|
950
|
+
return 0
|
|
808
951
|
|
|
809
952
|
|
|
810
953
|
def UpdateTimestampInFile() -> int:
|
|
@@ -887,6 +1030,7 @@ def DownloadCachableTools()->int:
|
|
|
887
1030
|
parser = argparse.ArgumentParser(description="Downloads all tools that are stored in the global ScriptCollection-cache (for example CycloneDX-CLI, PlantUML, MediaMTX, TruffleHog, OpenAPIGenerator and AndroidAppBundleTool). Running this - for example in a build-image - lets repeated pipeline-runs avoid rate-limits and run faster because the tools are already present.")
|
|
888
1031
|
parser.add_argument('-v', '--verbose', action='store_true', required=False, default=False, help="Enables verbose (debug) output.")
|
|
889
1032
|
parser.add_argument('-e', '--enforceupdate', action='store_true', required=False, default=False, help="Re-download the tools even if they are already present in the cache.")
|
|
1033
|
+
#TODO for each tool which will be installed allow to specify a specific version number
|
|
890
1034
|
args = parser.parse_args()
|
|
891
1035
|
sc: ScriptCollectionCore = ScriptCollectionCore()
|
|
892
1036
|
TFCPS_Tools_General(sc).download_all_cachable_tools(args.enforceupdate, args.verbose)
|
|
@@ -981,6 +1125,18 @@ def ShowProjectVersion() -> int:
|
|
|
981
1125
|
return 0
|
|
982
1126
|
|
|
983
1127
|
|
|
1128
|
+
def RunCommandInFolder() -> int:
|
|
1129
|
+
parser = argparse.ArgumentParser(description="Runs a command in a folder if (and only if) the folder is located inside the allowed folder.")
|
|
1130
|
+
parser.add_argument('-b', '--basefolder', required=True, help="Folder in which the command is executed in.")
|
|
1131
|
+
parser.add_argument('-c', '--command', required=True, help="Command which should be executed.")
|
|
1132
|
+
parser.add_argument('-a', '--arguments', required=False, default="", help="Arguments which should be passed to the command.")
|
|
1133
|
+
parser.add_argument('-e', '--excludedfolder', action='append', default=[], help="A folder (relative to basefolder) which is not allowed even if it lies inside basefolder. Can be specified multiple times. Example: --excludedfolder .git --excludedfolder .claude --excludedfolder Other/Secrets")
|
|
1134
|
+
parser.add_argument('-f', '--actualfolder', required=True, help="Folder-argument.")
|
|
1135
|
+
args = parser.parse_args()
|
|
1136
|
+
sc = ScriptCollectionCore()
|
|
1137
|
+
return sc.run_command_in_folder(args.basefolder, args.command, args.arguments, args.actualfolder, args.excludedfolder)
|
|
1138
|
+
|
|
1139
|
+
|
|
984
1140
|
def SyncXlfFiles()->int:
|
|
985
1141
|
parser = argparse.ArgumentParser(description="This function syncs the content of xlf-files in a folder. This is useful to keep the content of xlf-files in sync which are used for translations in software projects.")
|
|
986
1142
|
parser.add_argument('-p', '--prefix', required=True, help="File prefix. Example: 'message' when the files are named 'message.xlf', 'message.fr.xlf', etc.")
|
|
@@ -203,6 +203,8 @@ class GeneralUtilities:
|
|
|
203
203
|
raise ValueError("not implemented")#TODO
|
|
204
204
|
case VersionEcholon.LatestVersion:
|
|
205
205
|
return GeneralUtilities.get_latest_version(available_versions)
|
|
206
|
+
case VersionEcholon.NoUpdate:
|
|
207
|
+
return current_version
|
|
206
208
|
case _:
|
|
207
209
|
raise ValueError("Unknown echolon-value: "+str(echolon))
|
|
208
210
|
|
|
@@ -1140,7 +1142,7 @@ class GeneralUtilities:
|
|
|
1140
1142
|
def generate_password(length: int = 16, alphabet: str = None) -> None:
|
|
1141
1143
|
if alphabet is None:
|
|
1142
1144
|
alphabet = strin.ascii_letters + strin.digits+"_"
|
|
1143
|
-
return
|
|
1145
|
+
return GeneralUtilities.empty_string.join(secrets.choice(alphabet) for i in range(length))
|
|
1144
1146
|
|
|
1145
1147
|
@staticmethod
|
|
1146
1148
|
@check_arguments
|
|
@@ -1202,12 +1204,20 @@ class GeneralUtilities:
|
|
|
1202
1204
|
@staticmethod
|
|
1203
1205
|
@check_arguments
|
|
1204
1206
|
def internet_connection_is_available() -> bool:
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1207
|
+
"""Returns True as soon as any of a small set of well-known public hosts can be reached.
|
|
1208
|
+
Returns False only when none of the hosts answered (= no internet connectivity)."""
|
|
1209
|
+
hosts: list[str] = [
|
|
1210
|
+
"https://www.google.com",
|
|
1211
|
+
"https://www.wikipedia.org",
|
|
1212
|
+
"https://www.github.com",
|
|
1213
|
+
"https://www.cloudflare.com",
|
|
1214
|
+
]
|
|
1215
|
+
for host in hosts:
|
|
1216
|
+
try:
|
|
1217
|
+
with urllib.request.urlopen(host, timeout=10):
|
|
1218
|
+
return True
|
|
1219
|
+
except Exception:
|
|
1220
|
+
continue
|
|
1211
1221
|
return False
|
|
1212
1222
|
|
|
1213
1223
|
@staticmethod
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.23.0
|
ScriptCollection/SCLog.py
CHANGED
|
@@ -56,9 +56,6 @@ class SCLog:
|
|
|
56
56
|
if int(self.loglevel)<int(loglevel):
|
|
57
57
|
return
|
|
58
58
|
|
|
59
|
-
if message.endswith("\n"):
|
|
60
|
-
GeneralUtilities.write_message_to_stderr(f"invalid line: '{message}'") # TODO remove this
|
|
61
|
-
|
|
62
59
|
part1: str = GeneralUtilities.empty_string
|
|
63
60
|
part2: str = GeneralUtilities.empty_string
|
|
64
61
|
part3: str = "] "
|
|
@@ -38,7 +38,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
38
38
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
39
39
|
from .SCLog import SCLog, LogLevel
|
|
40
40
|
|
|
41
|
-
version = "4.2.
|
|
41
|
+
version = "4.2.135"
|
|
42
42
|
__version__ = version
|
|
43
43
|
|
|
44
44
|
class VSCodeWorkspaceShellTask:
|
|
@@ -163,6 +163,9 @@ class ScriptCollectionCore:
|
|
|
163
163
|
program_runner: ProgramRunnerBase = None
|
|
164
164
|
call_program_runner_directly: bool = None
|
|
165
165
|
log: SCLog = None
|
|
166
|
+
# Magic string which can be used inside the arguments of run_command_in_folder. Every occurrence of it will be replaced by the (resolved) actual_folder.
|
|
167
|
+
run_command_in_folder_actual_folder_placeholder: str = "{actual_folder}"
|
|
168
|
+
|
|
166
169
|
|
|
167
170
|
def __init__(self):
|
|
168
171
|
self.program_runner = ProgramRunnerPopen()
|
|
@@ -598,7 +601,7 @@ class ScriptCollectionCore:
|
|
|
598
601
|
@GeneralUtilities.check_arguments
|
|
599
602
|
def git_clone(self, clone_target_folder: str, remote_repository_path: str, include_submodules: bool = True, mirror: bool = False) -> None:
|
|
600
603
|
if (os.path.isdir(clone_target_folder)):
|
|
601
|
-
|
|
604
|
+
raise ValueError(f"Can not clone repository. Target folder '{clone_target_folder}' already exists as folder.")
|
|
602
605
|
else:
|
|
603
606
|
args = ["clone", remote_repository_path, clone_target_folder]
|
|
604
607
|
if include_submodules:
|
|
@@ -746,13 +749,13 @@ class ScriptCollectionCore:
|
|
|
746
749
|
@GeneralUtilities.check_arguments
|
|
747
750
|
def merge_repository(self, repository_folder: str, remote: str, branch: str):
|
|
748
751
|
GeneralUtilities.assert_condition(not self.git_repository_has_uncommitted_changes(repository_folder),f"Can not merge. There are uncommitted changes in \"{repository_folder}\".")
|
|
752
|
+
self.git_fetch(repository_folder, remote)
|
|
749
753
|
is_pullable: bool = self.git_commit_is_ancestor(repository_folder, branch, f"{remote}/{branch}")
|
|
750
754
|
if is_pullable:
|
|
751
755
|
self.git_pull(repository_folder, remote, branch, branch)
|
|
752
756
|
uncommitted_changes = self.git_repository_has_uncommitted_changes(repository_folder)
|
|
753
757
|
GeneralUtilities.assert_condition(not uncommitted_changes, f"Pulling remote \"{remote}\" in \"{repository_folder}\" caused new uncommitted files.")
|
|
754
758
|
self.git_checkout(repository_folder, branch)
|
|
755
|
-
self.git_fetch(repository_folder, remote)
|
|
756
759
|
self.git_merge(repository_folder, f"{remote}/{branch}", branch)
|
|
757
760
|
self.git_push_with_retry(repository_folder, remote, branch, branch)
|
|
758
761
|
self.git_checkout(repository_folder, branch)
|
|
@@ -1094,6 +1097,19 @@ class ScriptCollectionCore:
|
|
|
1094
1097
|
base64_string = base64_bytes.decode('utf-8')
|
|
1095
1098
|
self.run_program_argsasarray("scsetfilecontent", ["--path", path, "--argumentisinbase64", "--content", base64_string]) # works platform-indepent
|
|
1096
1099
|
|
|
1100
|
+
@GeneralUtilities.check_arguments
|
|
1101
|
+
def file_contains_content(self, path: str, content: str, treat_content_as_regex: bool = False, case_sensitive: bool = True, encoding: str = "utf-8") -> bool:
|
|
1102
|
+
"""Returns True if `content` appears in the file at `path`. With treat_content_as_regex=True
|
|
1103
|
+
the search is done via re.search, otherwise plain substring containment is checked."""
|
|
1104
|
+
GeneralUtilities.assert_file_exists(path)
|
|
1105
|
+
file_content = GeneralUtilities.read_text_from_file(path, encoding)
|
|
1106
|
+
if treat_content_as_regex:
|
|
1107
|
+
flags = 0 if case_sensitive else re.IGNORECASE
|
|
1108
|
+
return re.search(content, file_content, flags) is not None
|
|
1109
|
+
if case_sensitive:
|
|
1110
|
+
return content in file_content
|
|
1111
|
+
return content.lower() in file_content.lower()
|
|
1112
|
+
|
|
1097
1113
|
@GeneralUtilities.check_arguments
|
|
1098
1114
|
def remove(self, path: str) -> None:
|
|
1099
1115
|
"""This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
|
|
@@ -2022,6 +2038,39 @@ class ScriptCollectionCore:
|
|
|
2022
2038
|
return self.program_runner.run_program(program, arguments, working_directory, custom_argument, interactive, env_vars)
|
|
2023
2039
|
return self.run_program_argsasarray(program, GeneralUtilities.arguments_to_array(arguments), working_directory, print_errors_as_information, log_file, timeoutInSeconds, addLogOverhead, title, log_namespace, GeneralUtilities.arguments_to_array(arguments_for_log), throw_exception_if_exitcode_is_not_zero, custom_argument, interactive, print_live_output, env_vars)
|
|
2024
2040
|
|
|
2041
|
+
@GeneralUtilities.check_arguments
|
|
2042
|
+
def path_is_inside_one_of_the_folders(self, path: str, base_folder: str, folders: list[str]) -> bool:
|
|
2043
|
+
"""Returns whether path (a file or folder) is equal to or located inside one of the given folders. path and base_folder are resolved against the current working-directory; the entries of folders must be relative to base_folder."""
|
|
2044
|
+
resolved_path = GeneralUtilities.resolve_relative_path(path, os.getcwd())
|
|
2045
|
+
resolved_base_folder = GeneralUtilities.resolve_relative_path(base_folder, os.getcwd())
|
|
2046
|
+
normalized_path = os.path.normcase(os.path.normpath(resolved_path))
|
|
2047
|
+
normalized_base_folder = os.path.normcase(os.path.normpath(resolved_base_folder))
|
|
2048
|
+
for folder in folders:
|
|
2049
|
+
if os.path.isabs(folder):
|
|
2050
|
+
raise ValueError(f"The folder '{folder}' must be relative to the base-folder, but it is an absolute path.")
|
|
2051
|
+
normalized_folder = os.path.normcase(os.path.normpath(os.path.join(normalized_base_folder, folder)))
|
|
2052
|
+
if normalized_path == normalized_folder or normalized_path.startswith(normalized_folder + os.sep):
|
|
2053
|
+
return True
|
|
2054
|
+
return False
|
|
2055
|
+
|
|
2056
|
+
@GeneralUtilities.check_arguments
|
|
2057
|
+
def run_command_in_folder(self, base_folder: str, command: str, arguments: str, actual_folder: str, excluded_folders: list[str] = None) -> int:
|
|
2058
|
+
"""Runs the given command with the given arguments in base_folder, but only if actual_folder is equal to base_folder or a subfolder of it and not located inside one of the excluded_folders. The entries of excluded_folders must be relative to base_folder. actual_folder can be used in arguments by using the placeholder "{actual_folder}"."""
|
|
2059
|
+
if excluded_folders is None:
|
|
2060
|
+
excluded_folders = []
|
|
2061
|
+
resolved_actual_folder = GeneralUtilities.resolve_relative_path(actual_folder, os.getcwd())
|
|
2062
|
+
base_folder = GeneralUtilities.resolve_relative_path(base_folder, os.getcwd())
|
|
2063
|
+
normalized_actual_folder = os.path.normcase(os.path.normpath(resolved_actual_folder))
|
|
2064
|
+
normalized_base_folder = os.path.normcase(os.path.normpath(base_folder))
|
|
2065
|
+
actual_folder_is_allowed = normalized_actual_folder == normalized_base_folder or normalized_actual_folder.startswith(normalized_base_folder + os.sep)
|
|
2066
|
+
if not actual_folder_is_allowed:
|
|
2067
|
+
raise ValueError(f"The folder '{resolved_actual_folder}' is not allowed because it is neither equal to nor a subfolder of the allowed folder '{base_folder}'.")
|
|
2068
|
+
if self.path_is_inside_one_of_the_folders(actual_folder, base_folder, excluded_folders):
|
|
2069
|
+
raise ValueError(f"The folder '{resolved_actual_folder}' is not allowed because it is located inside one of the excluded folders (relative to the base-folder '{base_folder}').")
|
|
2070
|
+
effective_arguments = arguments.replace(ScriptCollectionCore.run_command_in_folder_actual_folder_placeholder, resolved_actual_folder)
|
|
2071
|
+
result = self.run_program(command, effective_arguments, base_folder)
|
|
2072
|
+
return result[0]
|
|
2073
|
+
|
|
2025
2074
|
# Return-values program_runner: Exitcode, StdOut, StdErr, Pid
|
|
2026
2075
|
@GeneralUtilities.check_arguments
|
|
2027
2076
|
def run_program_argsasarray_with_retry(self, program: str, arguments_as_array: list[str] = [], working_directory: str = None, 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, throw_exception_if_exitcode_is_not_zero: bool = True, custom_argument: object = None, interactive: bool = False, print_live_output: bool = False, amount_of_attempts: int = 5, delay_in_seconds: int = 2, env_vars: dict = None) -> tuple[int, str, str, int]:
|
|
@@ -98,7 +98,7 @@ class TFCPS_CodeUnit_BuildCodeUnit:
|
|
|
98
98
|
# TODO implement usage of reference_latest_version_of_xsd_when_generating_xml
|
|
99
99
|
GeneralUtilities.write_text_to_file(artifactsinformation_file, f"""<?xml version="1.0" encoding="UTF-8" ?>
|
|
100
100
|
<cps:artifactsinformation xmlns:cps="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure" artifactsinformationspecificationversion="1.0.0"
|
|
101
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://
|
|
101
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/raw/main/Conventions/RepositoryStructure/CommonProjectStructure/artifactsinformation.xsd">
|
|
102
102
|
<cps:name>{self.codeunit_name}</cps:name>
|
|
103
103
|
<cps:version>{codeunit_version}</cps:version>
|
|
104
104
|
<cps:timestamp>{moment}</cps:timestamp>
|
|
@@ -26,6 +26,9 @@ class TFCPS_Tools_General:
|
|
|
26
26
|
|
|
27
27
|
__sc:ScriptCollectionCore=None
|
|
28
28
|
oci_image_manager:OCIImageManager=None
|
|
29
|
+
# Relative path (inside the source-repository and inside the ScriptCollection.Resources-package) of the
|
|
30
|
+
# file that pins the OpenAPIGenerator-version used as default when no repository-specific version is given.
|
|
31
|
+
__openapigenerator_version_resource_relative_path:str="Dependencies/OpenAPIGenerator/Version.txt"
|
|
29
32
|
|
|
30
33
|
def __init__(self,sc:ScriptCollectionCore):
|
|
31
34
|
self.__sc=sc
|
|
@@ -443,7 +446,7 @@ class TFCPS_Tools_General:
|
|
|
443
446
|
# TODO implement usage of self.reference_latest_version_of_xsd_when_generating_xml
|
|
444
447
|
GeneralUtilities.write_text_to_file(constants_metafile, f"""<?xml version="1.0" encoding="UTF-8" ?>
|
|
445
448
|
<cps:constant xmlns:cps="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure" constantspecificationversion="1.1.0"
|
|
446
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/raw/main/Conventions/RepositoryStructure/CommonProjectStructure/constant.xsd">
|
|
449
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/raw/main/Conventions/RepositoryStructure/CommonProjectStructure/constant.xsd">
|
|
447
450
|
<cps:name>{constantname}</cps:name>
|
|
448
451
|
<cps:documentationsummary>{documentationsummary}</cps:documentationsummary>
|
|
449
452
|
<cps:path>{constants_valuefiler_reference}</cps:path>
|
|
@@ -985,7 +988,8 @@ class TFCPS_Tools_General:
|
|
|
985
988
|
grylibrary_dll_file_exists = os.path.isfile(grylibrary_dll_file)
|
|
986
989
|
if not os.path.isfile(grylibrary_dll_file):
|
|
987
990
|
self.__sc.log.log("Download GRYLibrary to global cache...",LogLevel.Information)
|
|
988
|
-
|
|
991
|
+
#TODO make version configurable instead of always using "latest"
|
|
992
|
+
grylibrary_latest_codeunit_file = "https://raw.githubusercontent.com/anionDevelopment/GRYLibrary/stable/GRYLibrary/GRYLibrary.codeunit.xml"
|
|
989
993
|
with urllib.request.urlopen(grylibrary_latest_codeunit_file) as url_result:
|
|
990
994
|
grylibrary_latest_version = self.get_version_of_codeunit_filecontent(url_result.read().decode("utf-8"))
|
|
991
995
|
if grylibrary_dll_file_exists:
|
|
@@ -996,7 +1000,7 @@ class TFCPS_Tools_General:
|
|
|
996
1000
|
GeneralUtilities.ensure_directory_does_not_exist(grylibrary_folder)
|
|
997
1001
|
GeneralUtilities.ensure_directory_exists(grylibrary_folder)
|
|
998
1002
|
archive_name = f"GRYLibrary.v{grylibrary_latest_version}.Artifacts.zip"
|
|
999
|
-
archive_download_link = f"https://github.com/
|
|
1003
|
+
archive_download_link = f"https://github.com/anionDevelopment/GRYLibrary/releases/download/v{grylibrary_latest_version}/{archive_name}"
|
|
1000
1004
|
archive_file = os.path.join(grylibrary_folder, archive_name)
|
|
1001
1005
|
urllib.request.urlretrieve(archive_download_link, archive_file)
|
|
1002
1006
|
with zipfile.ZipFile(archive_file, 'r') as zip_ref:
|
|
@@ -1022,6 +1026,7 @@ class TFCPS_Tools_General:
|
|
|
1022
1026
|
GeneralUtilities.ensure_directory_exists(ffmpeg_temp_folder)
|
|
1023
1027
|
zip_file_on_disk = os.path.join(ffmpeg_temp_folder, "ffmpeg.zip")
|
|
1024
1028
|
original_zip_filename = "ffmpeg-master-latest-win64-gpl-shared"
|
|
1029
|
+
#TODO make version configurable instead of always using "latest"
|
|
1025
1030
|
zip_link = f"https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/{original_zip_filename}.zip"
|
|
1026
1031
|
urllib.request.urlretrieve(zip_link, zip_file_on_disk)
|
|
1027
1032
|
shutil.unpack_archive(zip_file_on_disk, ffmpeg_temp_folder)
|
|
@@ -1163,7 +1168,13 @@ class TFCPS_Tools_General:
|
|
|
1163
1168
|
if not jar_file_exists:
|
|
1164
1169
|
self.__sc.log.log("Download OpenAPIGeneratorCLI...", LogLevel.Debug)
|
|
1165
1170
|
if pinned_version is None:
|
|
1166
|
-
|
|
1171
|
+
# No repository-specific version is pinned. This happens when the global cache is warmed
|
|
1172
|
+
# without a repository-context (e.g. scdownloadcachabletools in a build-image). Fall back
|
|
1173
|
+
# to the default version that ships with the ScriptCollection-package instead of failing.
|
|
1174
|
+
# Actual codeunit-builds always pass a repository_folder and therefore use the version
|
|
1175
|
+
# pinned in their own '<repo>/Other/Resources/Dependencies/OpenAPIGenerator/Version.txt'.
|
|
1176
|
+
pinned_version = self.get_default_openapigenerator_version()
|
|
1177
|
+
self.__sc.log.log(f"No repository-specific OpenAPIGenerator version pinned; falling back to default version '{pinned_version}'.", LogLevel.Debug)
|
|
1167
1178
|
version_to_download = pinned_version
|
|
1168
1179
|
download_link = f"https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/{version_to_download}/openapi-generator-cli-{version_to_download}.jar"
|
|
1169
1180
|
GeneralUtilities.ensure_directory_exists(openapigenerator_folder)
|
|
@@ -1199,6 +1210,23 @@ class TFCPS_Tools_General:
|
|
|
1199
1210
|
GeneralUtilities.assert_file_exists(version_file)
|
|
1200
1211
|
return GeneralUtilities.read_text_from_file(version_file).strip()
|
|
1201
1212
|
|
|
1213
|
+
@GeneralUtilities.check_arguments
|
|
1214
|
+
def get_default_openapigenerator_version(self) -> str:
|
|
1215
|
+
"""Returns the OpenAPIGenerator-version used when no repository-specific version is pinned
|
|
1216
|
+
(for example when warming the global cache via scdownloadcachabletools). The value is read from
|
|
1217
|
+
'<repo>/Other/Resources/Dependencies/OpenAPIGenerator/Version.txt', which the build copies into the
|
|
1218
|
+
ScriptCollection.Resources-package so it is available at runtime from the installed wheel."""
|
|
1219
|
+
try:
|
|
1220
|
+
# Default case: read the version-file that ships inside the installed package (wheel, build-image, ...).
|
|
1221
|
+
content = GeneralUtilities._internal_load_resource(TFCPS_Tools_General.__openapigenerator_version_resource_relative_path)
|
|
1222
|
+
return content.decode("utf-8").strip()
|
|
1223
|
+
except (FileNotFoundError, ModuleNotFoundError):
|
|
1224
|
+
# Fallback for running from an unbuilt source-checkout where the file has not been copied into the
|
|
1225
|
+
# package-resources yet: read the human-editable source-file directly from the repository.
|
|
1226
|
+
source_version_file = GeneralUtilities.resolve_relative_path(f"../../../Other/Resources/{TFCPS_Tools_General.__openapigenerator_version_resource_relative_path}", os.path.dirname(__file__))
|
|
1227
|
+
GeneralUtilities.assert_file_exists(source_version_file)
|
|
1228
|
+
return GeneralUtilities.read_text_from_file(source_version_file).strip()
|
|
1229
|
+
|
|
1202
1230
|
@GeneralUtilities.check_arguments
|
|
1203
1231
|
def update_images_in_example_with_default_excluded(self, codeunit_folder: str,custom_updater:AbstractImageHandler):
|
|
1204
1232
|
self.update_images_in_example(codeunit_folder,[],custom_updater)
|
|
@@ -1682,13 +1710,13 @@ class TFCPS_Tools_General:
|
|
|
1682
1710
|
|
|
1683
1711
|
@GeneralUtilities.check_arguments
|
|
1684
1712
|
def try_update_basic_codeunitreference_from_examples_repository(self, codeunit_folder:str,example_codeunit_name: str):
|
|
1685
|
-
source=f"https://raw.githubusercontent.com/
|
|
1713
|
+
source=f"https://raw.githubusercontent.com/anionDevelopment/CommonProjectStructureExamples/refs/heads/main/{example_codeunit_name}/Other/Reference/ReferenceContent/HowToBuild.md"
|
|
1686
1714
|
target=f"{codeunit_folder}/Other/Reference/ReferenceContent/HowToBuild.md"
|
|
1687
1715
|
self.download_file(source,target)
|
|
1688
1716
|
|
|
1689
1717
|
@GeneralUtilities.check_arguments
|
|
1690
1718
|
def try_update_basic_repositoryreference_from_examples_repository(self, repository_folder:str):
|
|
1691
|
-
source=f"https://raw.githubusercontent.com/
|
|
1719
|
+
source=f"https://raw.githubusercontent.com/anionDevelopment/CommonProjectStructureExamples/refs/heads/main/Other/Reference/RepositoryStructure.mdd"
|
|
1692
1720
|
target=f"{repository_folder}/Other/Reference/RepositoryStructure.md"
|
|
1693
1721
|
self.download_file(source,target)
|
|
1694
1722
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptcollection
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.135
|
|
4
4
|
Summary: The ScriptCollection is the place for reusable scripts.
|
|
5
5
|
Author-email: Marius Göcke <marius.goecke@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/anionDev/ScriptCollection
|
|
@@ -49,11 +49,11 @@ Requires-Dist: xmlschema>=4.3.1
|
|
|
49
49
|
|
|
50
50
|
[](https://pypi.org/project/ScriptCollection/)
|
|
51
51
|

|
|
52
|
-

|
|
53
53
|
|
|
54
|
-
[](https://www.codefactor.io/repository/github/anionDevevlopment/scriptcollection/overview/main)
|
|
55
55
|
[](https://pepy.tech/project/scriptcollection)
|
|
56
|
-

|
|
57
57
|
|
|
58
58
|
The ScriptCollection is the place for reusable scripts.
|
|
59
59
|
|
|
@@ -83,13 +83,13 @@ See the [PyPI-site for ScriptCollection](https://pypi.org/project/ScriptCollecti
|
|
|
83
83
|
|
|
84
84
|
You can simply git-clone the ScriptCollection and then use the scripts under the provided license.
|
|
85
85
|
|
|
86
|
-
`git clone https://github.com/
|
|
86
|
+
`git clone https://github.com/anionDevevlopment/ScriptCollection.git`
|
|
87
87
|
|
|
88
|
-
It may be more easy to pip-install the ScriptCollection but technically pip is not required. Actually you need to git-clone (or download as zip-file from [GitHub](https://github.com/
|
|
88
|
+
It may be more easy to pip-install the ScriptCollection but technically pip is not required. Actually you need to git-clone (or download as zip-file from [GitHub](https://github.com/anionDevevlopment/ScriptCollection) the ScriptCollection to use the scripts in this repository which are not written in python.
|
|
89
89
|
|
|
90
90
|
## Troubleshooting
|
|
91
91
|
|
|
92
|
-
It is recommended to always use only the newest version of the ScriptCollection. If you have an older version: Update it (e. g. using `pip3 install ScriptCollection --upgrade` if you installed the ScriptCollection via pip). If you still have problems, then feel free to create an [issue](https://github.com/
|
|
92
|
+
It is recommended to always use only the newest version of the ScriptCollection. If you have an older version: Update it (e. g. using `pip3 install ScriptCollection --upgrade` if you installed the ScriptCollection via pip). If you still have problems, then feel free to create an [issue](https://github.com/anionDevevlopment/ScriptCollection/issues).
|
|
93
93
|
|
|
94
94
|
If you have installed the ScriptCollection as pip-package you can simply check the version using Python with the following commands:
|
|
95
95
|
|
|
@@ -104,11 +104,11 @@ Or you can simply run `pip3 freeze` folder to get information about (all) curren
|
|
|
104
104
|
|
|
105
105
|
### Branching-system
|
|
106
106
|
|
|
107
|
-
This repository applies the [GitFlowSimplified](https://
|
|
107
|
+
This repository applies the [GitFlowSimplified](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/BranchingSystem/GitFlowSimplified/GitFlowSimplified.md)-branching-system.
|
|
108
108
|
|
|
109
109
|
### Repository-structure
|
|
110
110
|
|
|
111
|
-
This repository applies the [CommonProjectStructure](https://
|
|
111
|
+
This repository applies the [CommonProjectStructure](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/RepositoryStructure/CommonProjectStructure/CommonProjectStructure.md)-branching-system.
|
|
112
112
|
|
|
113
113
|
### Install dependencies
|
|
114
114
|
|
|
@@ -165,4 +165,4 @@ This tools must be available on the system where the functions should be execute
|
|
|
165
165
|
|
|
166
166
|
## License
|
|
167
167
|
|
|
168
|
-
See [License.txt](https://raw.githubusercontent.com/
|
|
168
|
+
See [License.txt](https://raw.githubusercontent.com/anionDevevlopment/ScriptCollection/main/License.txt) for license-information.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
ScriptCollection/AnionBuildPlatform.py,sha256=vg1lZ6D1nqq_mO7iYTDSktSImXd34scfPaXiIrbvrg0,11848
|
|
2
2
|
ScriptCollection/CertificateUpdater.py,sha256=dR5JpJDlZdjD4_pgMz7zCrt1IM7VfatmK6pULSczxQw,9693
|
|
3
|
-
ScriptCollection/Executables.py,sha256=
|
|
4
|
-
ScriptCollection/GeneralUtilities.py,sha256=
|
|
3
|
+
ScriptCollection/Executables.py,sha256=imXtRId8cl6dr13DnYuuGrlonu-AlZCCTlQnMH-D4bw,60922
|
|
4
|
+
ScriptCollection/GeneralUtilities.py,sha256=cJK18rWzmVT3KyvjIAbPK4o4-jVPwYeuVpizbTHjBDc,68136
|
|
5
5
|
ScriptCollection/HTTPMaintenanceOverheadHelper.py,sha256=TToNtyO1XzsMbBsTBf3o0xgOK0v4Jf03qw2Z0xb2nCk,2007
|
|
6
6
|
ScriptCollection/ProcessesRunner.py,sha256=yYaC95h40uszuZPggn2kK3qXIN2ZjGMCavo-NQ53ElQ,1537
|
|
7
7
|
ScriptCollection/ProgramRunnerBase.py,sha256=eZenpiIFW1dhvSVCG7cfBs5hO4_KLlOxR7oXoSxUDmk,2286
|
|
8
8
|
ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrRjAPIwT5Y,37
|
|
9
9
|
ScriptCollection/ProgramRunnerPopen.py,sha256=8tP0xWKeRYoGlaNB3iUh4o61O-tKtcxrS7IUqtU85C4,4091
|
|
10
10
|
ScriptCollection/ProgramRunnerSudo.py,sha256=RXsiceQ8W6a8YDk_2BPscVbIAmDIpIxqe9WHBy2r4CM,5233
|
|
11
|
-
ScriptCollection/SCLog.py,sha256=
|
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
11
|
+
ScriptCollection/SCLog.py,sha256=Z-HhC_CRtU3HdQflNsabFh9IJOucHcXmxMDcf58fli0,4671
|
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=X5Xwgmcx2gUl2qlCxmADokB7k2ngd14C0khY_-XVPoc,214596
|
|
13
13
|
ScriptCollection/UnassignedVariablesCheck.py,sha256=v59qLQ5RRvx31ouuCW7NWZj3McWENvGBPkV5ZGBmqJE,4344
|
|
14
14
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=o129UYDtLymCRjMZBP9Puaj19ueMHoNt6UTLspfnaRc,1758
|
|
@@ -24,16 +24,17 @@ ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGitlabEE.py,sha256=
|
|
|
24
24
|
ScriptCollection/OCIImages/ConcreteImageHandlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
ScriptCollection/Resources/CultureChooser/CultureChooser.js,sha256=5-4pwGDq5j1UnpTZy850ZMoxlM9tYPeu781QpZBtCWM,951
|
|
26
26
|
ScriptCollection/Resources/CultureChooser/index.html,sha256=gxQzbrSp4WU52TqN-gcBEtz2gJXmmM14OwTSFtFVRvw,276
|
|
27
|
+
ScriptCollection/Resources/Dependencies/OpenAPIGenerator/Version.txt,sha256=hdAgOhOHx4s13fJ-j0A06oYoM9rdEfDe0RzHoeAKXxo,7
|
|
27
28
|
ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz6xU2aGfr03tJRGczQrlpn-IeODc15d5kc0,232
|
|
28
29
|
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=sWnTspNrdwWFuPNX0dCZYFv7U0ggtUL_-iYqToaYSV4,28896
|
|
29
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=
|
|
30
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=WT4IzlzBaY46ogBeT2rvm_TnOE7HMw-cchJyTlmH5Og,9412
|
|
30
31
|
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=i7bpkQaw5_g2517WXc0cwUHb9Vfq7q_51WklWsfqRxA,19631
|
|
31
32
|
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=X2NgZgbOkJsdZ6wMHB_RuS_rQCuz5oQCqzYrxyXBN9Q,6680
|
|
32
33
|
ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=5vCFfDiU8bvfcnoKNs2ATS8nsl6mYXcIuX7XfYE0tvg,2116
|
|
33
34
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=BsSV4a-NZY86MZ20d-_rYxNVAI4UzAfmEwXlRZ8qWQc,7685
|
|
34
35
|
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=QRm8n1qH8H_XbJhGCbzwdNr9KSEy0WkbG7ulpc4Md3U,22696
|
|
35
36
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=JYiDqDsfVJQWS9xWMi_UzfXnXsJRnPRxAzFr82bUEvI,2370
|
|
36
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
|
37
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=sOlLPqQCy7v1UfVY9e3Jx3ObdvMd1aB46b7a0TDl844,114009
|
|
37
38
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
39
|
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=wS2yzYUmJ4m0cf6cBYVTHsiXSXfYhHoLFFy8x6yEQvY,19573
|
|
39
40
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -54,8 +55,8 @@ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=fqGhXNx8tK
|
|
|
54
55
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
56
|
ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
|
|
56
57
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
|
-
scriptcollection-4.2.
|
|
58
|
-
scriptcollection-4.2.
|
|
59
|
-
scriptcollection-4.2.
|
|
60
|
-
scriptcollection-4.2.
|
|
61
|
-
scriptcollection-4.2.
|
|
58
|
+
scriptcollection-4.2.135.dist-info/METADATA,sha256=v6okodlJ6oZP0xbcSbTf2CgJyuiZDjZvsNvV60k-OHI,7817
|
|
59
|
+
scriptcollection-4.2.135.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
60
|
+
scriptcollection-4.2.135.dist-info/entry_points.txt,sha256=Uh2xhKqpyqQX60Nbhq0CDDVOZKN5Gv5J9visugccKuc,5217
|
|
61
|
+
scriptcollection-4.2.135.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
62
|
+
scriptcollection-4.2.135.dist-info/RECORD,,
|
|
@@ -32,6 +32,7 @@ scgeneratecertificate = ScriptCollection.Executables:GenerateCertificate
|
|
|
32
32
|
scgeneratecertificateauthority = ScriptCollection.Executables:GenerateCertificateAuthority
|
|
33
33
|
scgeneratecertificatesignrequest = ScriptCollection.Executables:GenerateCertificateSignRequest
|
|
34
34
|
scgeneratesnkfiles = ScriptCollection.Executables:GenerateSnkFiles
|
|
35
|
+
scgeneratetaskfilefromworkspacefile = ScriptCollection.Executables:GenerateTaskfileFromWorkspacefile
|
|
35
36
|
scgeneratethumbnail = ScriptCollection.Executables:GenerateThumbnail
|
|
36
37
|
scgetsize = ScriptCollection.Executables:GetSize
|
|
37
38
|
schealthcheck = ScriptCollection.Executables:Healthcheck
|
|
@@ -56,6 +57,7 @@ scremovefile = ScriptCollection.Executables:RemoveFile
|
|
|
56
57
|
scremovefolder = ScriptCollection.Executables:RemoveFolder
|
|
57
58
|
screname = ScriptCollection.Executables:Rename
|
|
58
59
|
screplacesubstringsinfilenames = ScriptCollection.Executables:ReplaceSubstringsInFilenames
|
|
60
|
+
scruncommandinfolder = ScriptCollection.Executables:RunCommandInFolder
|
|
59
61
|
scsearchforsecrets = ScriptCollection.Executables:SearchForSecrets
|
|
60
62
|
scsearchinfiles = ScriptCollection.Executables:SearchInFiles
|
|
61
63
|
scsetcontentoffile = ScriptCollection.Executables:SetContentOfFile
|
|
File without changes
|
|
File without changes
|