ScriptCollection 4.2.133__py3-none-any.whl → 4.2.134__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 +173 -35
- ScriptCollection/GeneralUtilities.py +17 -7
- ScriptCollection/SCLog.py +0 -3
- ScriptCollection/ScriptCollectionCore.py +15 -2
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py +1 -1
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +6 -5
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.134.dist-info}/METADATA +10 -10
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.134.dist-info}/RECORD +11 -11
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.134.dist-info}/entry_points.txt +1 -0
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.134.dist-info}/WHEEL +0 -0
- {scriptcollection-4.2.133.dist-info → scriptcollection-4.2.134.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
|
|
@@ -466,17 +469,52 @@ def CreateFolder() -> int:
|
|
|
466
469
|
|
|
467
470
|
|
|
468
471
|
def AppendLineToFile() -> int:
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
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).")
|
|
473
|
+
parser.add_argument('-p', '--path', required=True)
|
|
474
|
+
parser.add_argument('-l', '--line', required=True, help='Line content to append (without trailing newline).')
|
|
475
|
+
parser.add_argument('-e', '--encoding', default="utf-8")
|
|
476
|
+
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).')
|
|
477
|
+
parser.add_argument('--no-trailing-newline', action='store_true', default=False, help='Do not append a trailing newline character after the line.')
|
|
478
|
+
args = parser.parse_args()
|
|
479
|
+
if not os.path.isfile(args.path):
|
|
480
|
+
GeneralUtilities.write_message_to_stderr(f"File '{args.path}' does not exist.")
|
|
481
|
+
return 1
|
|
482
|
+
existing = GeneralUtilities.read_text_from_file(args.path, args.encoding)
|
|
483
|
+
if not existing:
|
|
484
|
+
prefix = ""
|
|
485
|
+
elif existing.endswith("\n") and args.skip_leading_newline_if_file_already_ends_with_newline:
|
|
486
|
+
prefix = ""
|
|
487
|
+
else:
|
|
488
|
+
prefix = "\n"
|
|
489
|
+
suffix = "" if args.no_trailing_newline else "\n"
|
|
490
|
+
GeneralUtilities.write_text_to_file(args.path, existing + prefix + args.line + suffix, args.encoding)
|
|
491
|
+
return 0
|
|
474
492
|
|
|
475
493
|
|
|
476
494
|
def RegexReplaceInFile() -> int:
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
495
|
+
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.")
|
|
496
|
+
parser.add_argument('-p', '--path', required=True)
|
|
497
|
+
parser.add_argument('-r', '--pattern', required=True, help='Regular expression to match.')
|
|
498
|
+
parser.add_argument('-w', '--replacement', required=True, help='Replacement string (supports backreferences such as \\1).')
|
|
499
|
+
parser.add_argument('-e', '--encoding', default="utf-8")
|
|
500
|
+
parser.add_argument('-i', '--case-insensitive', action='store_true', default=False)
|
|
501
|
+
parser.add_argument('-m', '--multiline', action='store_true', default=False, help='Enable re.MULTILINE (^ and $ match at line boundaries).')
|
|
502
|
+
parser.add_argument('-d', '--dotall', action='store_true', default=False, help='Enable re.DOTALL (. matches newlines).')
|
|
503
|
+
args = parser.parse_args()
|
|
504
|
+
if not os.path.isfile(args.path):
|
|
505
|
+
GeneralUtilities.write_message_to_stderr(f"File '{args.path}' does not exist.")
|
|
506
|
+
return 1
|
|
507
|
+
flags = 0
|
|
508
|
+
if args.case_insensitive:
|
|
509
|
+
flags |= re.IGNORECASE
|
|
510
|
+
if args.multiline:
|
|
511
|
+
flags |= re.MULTILINE
|
|
512
|
+
if args.dotall:
|
|
513
|
+
flags |= re.DOTALL
|
|
514
|
+
content = GeneralUtilities.read_text_from_file(args.path, args.encoding)
|
|
515
|
+
new_content = re.sub(args.pattern, args.replacement, content, flags=flags)
|
|
516
|
+
GeneralUtilities.write_text_to_file(args.path, new_content, args.encoding)
|
|
517
|
+
return 0
|
|
480
518
|
|
|
481
519
|
|
|
482
520
|
def PrintFileSize() -> int:
|
|
@@ -494,10 +532,19 @@ def PrintFileSize() -> int:
|
|
|
494
532
|
|
|
495
533
|
|
|
496
534
|
def FileContainsContent() -> int:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
535
|
+
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).")
|
|
536
|
+
parser.add_argument('-p', '--path', required=True)
|
|
537
|
+
parser.add_argument('-c', '--content', required=True, help='Substring (or regex if --regex is set) to search for.')
|
|
538
|
+
parser.add_argument('-r', '--regex', action='store_true', default=False, help='Treat --content as a regular expression.')
|
|
539
|
+
parser.add_argument('-i', '--case-insensitive', action='store_true', default=False, help='Match case-insensitively.')
|
|
540
|
+
parser.add_argument('-e', '--encoding', default="utf-8")
|
|
541
|
+
args = parser.parse_args()
|
|
542
|
+
if not os.path.isfile(args.path):
|
|
543
|
+
GeneralUtilities.write_message_to_stderr(f"File '{args.path}' does not exist.")
|
|
544
|
+
return 1
|
|
545
|
+
sc = ScriptCollectionCore()
|
|
546
|
+
found = sc.file_contains_content(args.path, args.content, args.regex, not args.case_insensitive, args.encoding)
|
|
547
|
+
return 0 if found else 2
|
|
501
548
|
|
|
502
549
|
|
|
503
550
|
def RemoveFile() -> int:
|
|
@@ -602,31 +649,116 @@ def ListFolderContent() -> int:
|
|
|
602
649
|
parser.add_argument('-f', '--excludefiles', action='store_true', required=False, default=False)
|
|
603
650
|
parser.add_argument('-d', '--excludedirectories', action='store_true', required=False, default=False)
|
|
604
651
|
parser.add_argument('-n', '--printonlynamewithoutpath', action='store_true', required=False, default=False)
|
|
605
|
-
|
|
606
|
-
|
|
652
|
+
parser.add_argument('-t', '--transitive', action='store_true', required=False, default=False, help='Recurse into subfolders.')
|
|
653
|
+
filter_group = parser.add_mutually_exclusive_group()
|
|
654
|
+
filter_group.add_argument('--extension', help='Comma-separated list of file extensions (without dot) to include, e.g. "py,md".')
|
|
655
|
+
filter_group.add_argument('--glob', help='Glob pattern matched against entry basename, e.g. "*.py" or "test_*".')
|
|
656
|
+
filter_group.add_argument('--regex', help='Regex pattern matched against entry basename.')
|
|
607
657
|
args = parser.parse_args()
|
|
608
658
|
folder = args.path
|
|
609
659
|
if not os.path.isabs(folder):
|
|
610
660
|
folder = GeneralUtilities.resolve_relative_path(folder, os.getcwd())
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
if
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
661
|
+
if not os.path.isdir(folder):
|
|
662
|
+
GeneralUtilities.write_message_to_stderr(f"Folder '{folder}' does not exist.")
|
|
663
|
+
return 1
|
|
664
|
+
if args.excludefiles and args.excludedirectories:
|
|
665
|
+
GeneralUtilities.write_message_to_stderr("Nothing to list: both files and folders are excluded.")
|
|
666
|
+
return 1
|
|
667
|
+
extensions: set[str] = None
|
|
668
|
+
if args.extension is not None:
|
|
669
|
+
extensions = {e.strip().lower().lstrip(".") for e in args.extension.split(",") if e.strip()}
|
|
670
|
+
|
|
671
|
+
def matches_filter(entry_path: str) -> bool:
|
|
672
|
+
basename = os.path.basename(entry_path)
|
|
673
|
+
if extensions is not None:
|
|
674
|
+
ext = os.path.splitext(basename)[1].lstrip(".").lower()
|
|
675
|
+
return ext in extensions
|
|
676
|
+
if args.glob is not None:
|
|
677
|
+
return fnmatch.fnmatch(basename, args.glob)
|
|
678
|
+
if args.regex is not None:
|
|
679
|
+
return re.search(args.regex, basename) is not None
|
|
680
|
+
return True
|
|
681
|
+
|
|
682
|
+
entries: list[str] = []
|
|
683
|
+
if args.transitive:
|
|
684
|
+
for current_root, subfolders, files in os.walk(folder):
|
|
685
|
+
if not args.excludedirectories:
|
|
686
|
+
for subfolder in subfolders:
|
|
687
|
+
entries.append(os.path.join(current_root, subfolder))
|
|
688
|
+
if not args.excludefiles:
|
|
689
|
+
for file in files:
|
|
690
|
+
entries.append(os.path.join(current_root, file))
|
|
691
|
+
else:
|
|
692
|
+
if not args.excludefiles:
|
|
693
|
+
entries = entries + GeneralUtilities.get_direct_files_of_folder(folder)
|
|
694
|
+
if not args.excludedirectories:
|
|
695
|
+
entries = entries + GeneralUtilities.get_direct_folders_of_folder(folder)
|
|
696
|
+
|
|
697
|
+
for entry in entries:
|
|
698
|
+
if not matches_filter(entry):
|
|
699
|
+
continue
|
|
700
|
+
content_to_print = os.path.basename(entry) if args.printonlynamewithoutpath else entry
|
|
622
701
|
GeneralUtilities.write_message_to_stdout(content_to_print)
|
|
623
702
|
return 0
|
|
624
703
|
|
|
625
704
|
|
|
626
705
|
def ForEach() -> int:
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
706
|
+
parser = argparse.ArgumentParser(
|
|
707
|
+
description=(
|
|
708
|
+
"Iterates the entries of a folder and runs a command for each one. The placeholder '{path}' "
|
|
709
|
+
"in the command template is replaced with the entry's absolute path before execution. "
|
|
710
|
+
"By default only direct child entries are processed; with --transitive the whole subtree is walked. "
|
|
711
|
+
"By default only files are processed; use --include-folders to also process folders.\n"
|
|
712
|
+
"\n"
|
|
713
|
+
"Example: scforeach -f . -c \"git -C \\\"{path}\\\" status -s\" --include-folders --skip-files"
|
|
714
|
+
),
|
|
715
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
716
|
+
)
|
|
717
|
+
parser.add_argument('-f', '--folder', required=True, help='Folder whose entries should be iterated.')
|
|
718
|
+
parser.add_argument('-c', '--command', required=True, help='Command template. Use "{path}" as placeholder for the entry path.')
|
|
719
|
+
parser.add_argument('-t', '--transitive', action='store_true', default=False, help='Recurse into subfolders.')
|
|
720
|
+
parser.add_argument('--include-folders', action='store_true', default=False, help='Also process folder entries (default: only files).')
|
|
721
|
+
parser.add_argument('--skip-files', action='store_true', default=False, help='Skip file entries (useful in combination with --include-folders).')
|
|
722
|
+
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.')
|
|
723
|
+
args = parser.parse_args()
|
|
724
|
+
if not os.path.isdir(args.folder):
|
|
725
|
+
GeneralUtilities.write_message_to_stderr(f"Folder '{args.folder}' does not exist.")
|
|
726
|
+
return 1
|
|
727
|
+
process_files = not args.skip_files
|
|
728
|
+
process_folders = args.include_folders
|
|
729
|
+
if not process_files and not process_folders:
|
|
730
|
+
GeneralUtilities.write_message_to_stderr("Nothing to do: both files and folders are excluded.")
|
|
731
|
+
return 1
|
|
732
|
+
entries: list[str] = []
|
|
733
|
+
if args.transitive:
|
|
734
|
+
for current_root, subfolders, files in os.walk(args.folder):
|
|
735
|
+
if process_folders:
|
|
736
|
+
for subfolder in subfolders:
|
|
737
|
+
entries.append(os.path.join(current_root, subfolder))
|
|
738
|
+
if process_files:
|
|
739
|
+
for file in files:
|
|
740
|
+
entries.append(os.path.join(current_root, file))
|
|
741
|
+
else:
|
|
742
|
+
for entry_name in os.listdir(args.folder):
|
|
743
|
+
entry_path = os.path.join(args.folder, entry_name)
|
|
744
|
+
if os.path.isfile(entry_path) and process_files:
|
|
745
|
+
entries.append(entry_path)
|
|
746
|
+
elif os.path.isdir(entry_path) and process_folders:
|
|
747
|
+
entries.append(entry_path)
|
|
748
|
+
aggregate_exit_code = 0
|
|
749
|
+
for entry_path in entries:
|
|
750
|
+
absolute_entry_path = os.path.abspath(entry_path)
|
|
751
|
+
rendered_command = args.command.replace("{path}", absolute_entry_path)
|
|
752
|
+
completed = subprocess.run(rendered_command, shell=True, capture_output=True, text=True, check=False)
|
|
753
|
+
if completed.stdout:
|
|
754
|
+
GeneralUtilities.write_message_to_stdout(completed.stdout.rstrip("\n"))
|
|
755
|
+
if completed.stderr:
|
|
756
|
+
GeneralUtilities.write_message_to_stderr(completed.stderr.rstrip("\n"))
|
|
757
|
+
if completed.returncode != 0:
|
|
758
|
+
aggregate_exit_code = completed.returncode
|
|
759
|
+
if not args.continue_on_error:
|
|
760
|
+
return aggregate_exit_code
|
|
761
|
+
return aggregate_exit_code
|
|
630
762
|
|
|
631
763
|
|
|
632
764
|
def NpmI() -> int:
|
|
@@ -798,13 +930,19 @@ def SetFileContent() -> int:
|
|
|
798
930
|
|
|
799
931
|
|
|
800
932
|
def GenerateTaskfileFromWorkspacefile() -> int:
|
|
801
|
-
parser = argparse.ArgumentParser(description="Generates a
|
|
802
|
-
parser.add_argument('-f', '--repositoryfolder', required=True)
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
933
|
+
parser = argparse.ArgumentParser(description="Generates a Taskfile.yml file from a .code-workspace file.")
|
|
934
|
+
parser.add_argument('-f', '--repositoryfolder', required=True, help='Repository folder containing the .code-workspace file.')
|
|
935
|
+
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.')
|
|
936
|
+
args = parser.parse_args()
|
|
937
|
+
repository_folder = args.repositoryfolder
|
|
938
|
+
if not os.path.isabs(repository_folder):
|
|
939
|
+
repository_folder = GeneralUtilities.resolve_relative_path(repository_folder, os.getcwd())
|
|
940
|
+
if not os.path.isdir(repository_folder):
|
|
941
|
+
GeneralUtilities.write_message_to_stderr(f"Folder '{repository_folder}' does not exist.")
|
|
942
|
+
return 1
|
|
943
|
+
sc = ScriptCollectionCore()
|
|
944
|
+
TFCPS_Tools_General(sc).generate_tasksfile_from_workspace_file(repository_folder, args.appendcliargs)
|
|
945
|
+
return 0
|
|
808
946
|
|
|
809
947
|
|
|
810
948
|
def UpdateTimestampInFile() -> int:
|
|
@@ -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
|
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.134"
|
|
42
42
|
__version__ = version
|
|
43
43
|
|
|
44
44
|
class VSCodeWorkspaceShellTask:
|
|
@@ -598,7 +598,7 @@ class ScriptCollectionCore:
|
|
|
598
598
|
@GeneralUtilities.check_arguments
|
|
599
599
|
def git_clone(self, clone_target_folder: str, remote_repository_path: str, include_submodules: bool = True, mirror: bool = False) -> None:
|
|
600
600
|
if (os.path.isdir(clone_target_folder)):
|
|
601
|
-
|
|
601
|
+
raise ValueError(f"Can not clone repository. Target folder '{clone_target_folder}' already exists as folder.")
|
|
602
602
|
else:
|
|
603
603
|
args = ["clone", remote_repository_path, clone_target_folder]
|
|
604
604
|
if include_submodules:
|
|
@@ -1094,6 +1094,19 @@ class ScriptCollectionCore:
|
|
|
1094
1094
|
base64_string = base64_bytes.decode('utf-8')
|
|
1095
1095
|
self.run_program_argsasarray("scsetfilecontent", ["--path", path, "--argumentisinbase64", "--content", base64_string]) # works platform-indepent
|
|
1096
1096
|
|
|
1097
|
+
@GeneralUtilities.check_arguments
|
|
1098
|
+
def file_contains_content(self, path: str, content: str, treat_content_as_regex: bool = False, case_sensitive: bool = True, encoding: str = "utf-8") -> bool:
|
|
1099
|
+
"""Returns True if `content` appears in the file at `path`. With treat_content_as_regex=True
|
|
1100
|
+
the search is done via re.search, otherwise plain substring containment is checked."""
|
|
1101
|
+
GeneralUtilities.assert_file_exists(path)
|
|
1102
|
+
file_content = GeneralUtilities.read_text_from_file(path, encoding)
|
|
1103
|
+
if treat_content_as_regex:
|
|
1104
|
+
flags = 0 if case_sensitive else re.IGNORECASE
|
|
1105
|
+
return re.search(content, file_content, flags) is not None
|
|
1106
|
+
if case_sensitive:
|
|
1107
|
+
return content in file_content
|
|
1108
|
+
return content.lower() in file_content.lower()
|
|
1109
|
+
|
|
1097
1110
|
@GeneralUtilities.check_arguments
|
|
1098
1111
|
def remove(self, path: str) -> None:
|
|
1099
1112
|
"""This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
|
|
@@ -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>
|
|
@@ -443,7 +443,7 @@ class TFCPS_Tools_General:
|
|
|
443
443
|
# TODO implement usage of self.reference_latest_version_of_xsd_when_generating_xml
|
|
444
444
|
GeneralUtilities.write_text_to_file(constants_metafile, f"""<?xml version="1.0" encoding="UTF-8" ?>
|
|
445
445
|
<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">
|
|
446
|
+
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
447
|
<cps:name>{constantname}</cps:name>
|
|
448
448
|
<cps:documentationsummary>{documentationsummary}</cps:documentationsummary>
|
|
449
449
|
<cps:path>{constants_valuefiler_reference}</cps:path>
|
|
@@ -985,7 +985,7 @@ class TFCPS_Tools_General:
|
|
|
985
985
|
grylibrary_dll_file_exists = os.path.isfile(grylibrary_dll_file)
|
|
986
986
|
if not os.path.isfile(grylibrary_dll_file):
|
|
987
987
|
self.__sc.log.log("Download GRYLibrary to global cache...",LogLevel.Information)
|
|
988
|
-
grylibrary_latest_codeunit_file = "https://raw.githubusercontent.com/
|
|
988
|
+
grylibrary_latest_codeunit_file = "https://raw.githubusercontent.com/anionDevelopment/GRYLibrary/stable/GRYLibrary/GRYLibrary.codeunit.xml"
|
|
989
989
|
with urllib.request.urlopen(grylibrary_latest_codeunit_file) as url_result:
|
|
990
990
|
grylibrary_latest_version = self.get_version_of_codeunit_filecontent(url_result.read().decode("utf-8"))
|
|
991
991
|
if grylibrary_dll_file_exists:
|
|
@@ -996,7 +996,7 @@ class TFCPS_Tools_General:
|
|
|
996
996
|
GeneralUtilities.ensure_directory_does_not_exist(grylibrary_folder)
|
|
997
997
|
GeneralUtilities.ensure_directory_exists(grylibrary_folder)
|
|
998
998
|
archive_name = f"GRYLibrary.v{grylibrary_latest_version}.Artifacts.zip"
|
|
999
|
-
archive_download_link = f"https://github.com/
|
|
999
|
+
archive_download_link = f"https://github.com/anionDevelopment/GRYLibrary/releases/download/v{grylibrary_latest_version}/{archive_name}"
|
|
1000
1000
|
archive_file = os.path.join(grylibrary_folder, archive_name)
|
|
1001
1001
|
urllib.request.urlretrieve(archive_download_link, archive_file)
|
|
1002
1002
|
with zipfile.ZipFile(archive_file, 'r') as zip_ref:
|
|
@@ -1022,6 +1022,7 @@ class TFCPS_Tools_General:
|
|
|
1022
1022
|
GeneralUtilities.ensure_directory_exists(ffmpeg_temp_folder)
|
|
1023
1023
|
zip_file_on_disk = os.path.join(ffmpeg_temp_folder, "ffmpeg.zip")
|
|
1024
1024
|
original_zip_filename = "ffmpeg-master-latest-win64-gpl-shared"
|
|
1025
|
+
#TODO make version configurable instead of always using "latest"
|
|
1025
1026
|
zip_link = f"https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/{original_zip_filename}.zip"
|
|
1026
1027
|
urllib.request.urlretrieve(zip_link, zip_file_on_disk)
|
|
1027
1028
|
shutil.unpack_archive(zip_file_on_disk, ffmpeg_temp_folder)
|
|
@@ -1682,13 +1683,13 @@ class TFCPS_Tools_General:
|
|
|
1682
1683
|
|
|
1683
1684
|
@GeneralUtilities.check_arguments
|
|
1684
1685
|
def try_update_basic_codeunitreference_from_examples_repository(self, codeunit_folder:str,example_codeunit_name: str):
|
|
1685
|
-
source=f"https://raw.githubusercontent.com/
|
|
1686
|
+
source=f"https://raw.githubusercontent.com/anionDevelopment/CommonProjectStructureExamples/refs/heads/main/{example_codeunit_name}/Other/Reference/ReferenceContent/HowToBuild.md"
|
|
1686
1687
|
target=f"{codeunit_folder}/Other/Reference/ReferenceContent/HowToBuild.md"
|
|
1687
1688
|
self.download_file(source,target)
|
|
1688
1689
|
|
|
1689
1690
|
@GeneralUtilities.check_arguments
|
|
1690
1691
|
def try_update_basic_repositoryreference_from_examples_repository(self, repository_folder:str):
|
|
1691
|
-
source=f"https://raw.githubusercontent.com/
|
|
1692
|
+
source=f"https://raw.githubusercontent.com/anionDevelopment/CommonProjectStructureExamples/refs/heads/main/Other/Reference/RepositoryStructure.mdd"
|
|
1692
1693
|
target=f"{repository_folder}/Other/Reference/RepositoryStructure.md"
|
|
1693
1694
|
self.download_file(source,target)
|
|
1694
1695
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptcollection
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.134
|
|
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=rGm6_RTp7ONqBsfxAZ7k3-_2R4-Nv_iCD3QCmfxmTQM,58904
|
|
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=c9TalP669QCylUZRKKbV6tLf0yUgC3KkkZC5CHlXrcg,211260
|
|
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
|
|
@@ -26,14 +26,14 @@ ScriptCollection/Resources/CultureChooser/CultureChooser.js,sha256=5-4pwGDq5j1Un
|
|
|
26
26
|
ScriptCollection/Resources/CultureChooser/index.html,sha256=gxQzbrSp4WU52TqN-gcBEtz2gJXmmM14OwTSFtFVRvw,276
|
|
27
27
|
ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz6xU2aGfr03tJRGczQrlpn-IeODc15d5kc0,232
|
|
28
28
|
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=sWnTspNrdwWFuPNX0dCZYFv7U0ggtUL_-iYqToaYSV4,28896
|
|
29
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=
|
|
29
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=WT4IzlzBaY46ogBeT2rvm_TnOE7HMw-cchJyTlmH5Og,9412
|
|
30
30
|
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=i7bpkQaw5_g2517WXc0cwUHb9Vfq7q_51WklWsfqRxA,19631
|
|
31
31
|
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=X2NgZgbOkJsdZ6wMHB_RuS_rQCuz5oQCqzYrxyXBN9Q,6680
|
|
32
32
|
ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=5vCFfDiU8bvfcnoKNs2ATS8nsl6mYXcIuX7XfYE0tvg,2116
|
|
33
33
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=BsSV4a-NZY86MZ20d-_rYxNVAI4UzAfmEwXlRZ8qWQc,7685
|
|
34
34
|
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=QRm8n1qH8H_XbJhGCbzwdNr9KSEy0WkbG7ulpc4Md3U,22696
|
|
35
35
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=JYiDqDsfVJQWS9xWMi_UzfXnXsJRnPRxAzFr82bUEvI,2370
|
|
36
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
|
36
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=lj4d5AEc3rvYtTRl_9aGrS7QGt0G50dcigiMSEHATgo,111627
|
|
37
37
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=wS2yzYUmJ4m0cf6cBYVTHsiXSXfYhHoLFFy8x6yEQvY,19573
|
|
39
39
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -54,8 +54,8 @@ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=fqGhXNx8tK
|
|
|
54
54
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
55
|
ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
|
|
56
56
|
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.
|
|
57
|
+
scriptcollection-4.2.134.dist-info/METADATA,sha256=6QpUp8lFVeWsgqTw7awn9FxiLxI9Cx0i_sIiWSHqzcw,7817
|
|
58
|
+
scriptcollection-4.2.134.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
59
|
+
scriptcollection-4.2.134.dist-info/entry_points.txt,sha256=JMtVnhDDQRy0dyMueLct_MLgaESHO24Q3vj7kgUFsT8,5146
|
|
60
|
+
scriptcollection-4.2.134.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
61
|
+
scriptcollection-4.2.134.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
|
|
File without changes
|
|
File without changes
|