ScriptCollection 3.5.105__py3-none-any.whl → 3.5.106__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.
@@ -133,33 +133,34 @@ class GeneralUtilities:
133
133
 
134
134
  @staticmethod
135
135
  @check_arguments
136
- def copy_content_of_folder(source_directory: str, target_directory: str, overwrite_existing_files=False) -> None:
137
- GeneralUtilities.__copy_or_move_content_of_folder(source_directory, target_directory, overwrite_existing_files, False)
136
+ def copy_content_of_folder(source_directory: str, target_directory: str, overwrite_existing_files=False,filtertext:str=None) -> None:
137
+ GeneralUtilities.__copy_or_move_content_of_folder(source_directory, target_directory, overwrite_existing_files, False,filtertext)
138
138
 
139
139
  @staticmethod
140
140
  @check_arguments
141
- def move_content_of_folder(source_directory: str, target_directory: str, overwrite_existing_files=False) -> None:
142
- GeneralUtilities.__copy_or_move_content_of_folder(source_directory, target_directory, overwrite_existing_files, True)
141
+ def move_content_of_folder(source_directory: str, target_directory: str, overwrite_existing_files=False,filtertext:str=None) -> None:
142
+ GeneralUtilities.__copy_or_move_content_of_folder(source_directory, target_directory, overwrite_existing_files, True,filtertext)
143
143
 
144
144
  @staticmethod
145
145
  @check_arguments
146
- def __copy_or_move_content_of_folder(source_directory: str, target_directory: str, overwrite_existing_files, remove_source: bool) -> None:
146
+ def __copy_or_move_content_of_folder(source_directory: str, target_directory: str, overwrite_existing_files, remove_source: bool,filtertext:str=None) -> None:
147
147
  srcDirFull = GeneralUtilities.resolve_relative_path_from_current_working_directory(source_directory)
148
148
  dstDirFull = GeneralUtilities.resolve_relative_path_from_current_working_directory(target_directory)
149
149
  if (os.path.isdir(source_directory)):
150
150
  GeneralUtilities.ensure_directory_exists(target_directory)
151
151
  for file in GeneralUtilities.get_direct_files_of_folder(srcDirFull):
152
152
  filename = os.path.basename(file)
153
- targetfile = os.path.join(dstDirFull, filename)
154
- if (os.path.isfile(targetfile)):
155
- if overwrite_existing_files:
156
- GeneralUtilities.ensure_file_does_not_exist(targetfile)
153
+ if filtertext is None or re.match(filtertext, file):
154
+ targetfile = os.path.join(dstDirFull, filename)
155
+ if (os.path.isfile(targetfile)):
156
+ if overwrite_existing_files:
157
+ GeneralUtilities.ensure_file_does_not_exist(targetfile)
158
+ else:
159
+ raise ValueError(f"Targetfile '{targetfile}' does already exist.")
160
+ if remove_source:
161
+ shutil.move(file, dstDirFull)
157
162
  else:
158
- raise ValueError(f"Targetfile {targetfile} does already exist")
159
- if remove_source:
160
- shutil.move(file, dstDirFull)
161
- else:
162
- shutil.copy(file, dstDirFull)
163
+ shutil.copy(file, dstDirFull)
163
164
  for sub_folder in GeneralUtilities.get_direct_folders_of_folder(srcDirFull):
164
165
  foldername = os.path.basename(sub_folder)
165
166
  sub_target = os.path.join(dstDirFull, foldername)
@@ -33,7 +33,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
33
33
  from .ProgramRunnerPopen import ProgramRunnerPopen
34
34
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
35
35
 
36
- version = "3.5.105"
36
+ version = "3.5.106"
37
37
  __version__ = version
38
38
 
39
39
 
@@ -3298,3 +3298,20 @@ class TasksForCommonProjectStructure:
3298
3298
  @GeneralUtilities.check_arguments
3299
3299
  def install_requirementstxt_for_repository(self, repository_folde: str,verbosity:int):
3300
3300
  self.__sc.install_requirementstxt_file(repository_folde+"/Other/requirements.txt", verbosity)
3301
+
3302
+ @GeneralUtilities.check_arguments
3303
+ def update_submodule(self, repository_folder: str, submodule_name:str):
3304
+ submodule_folder = GeneralUtilities.resolve_relative_path("Other/Resources/Submodules/"+submodule_name, repository_folder)
3305
+ self.__sc.git_fetch(submodule_folder, "origin")
3306
+ self.__sc.git_checkout(submodule_folder, "main")
3307
+ self.__sc.git_pull(submodule_folder, "origin", "main", "main", True)
3308
+ current_version = self.__sc.get_semver_version_from_gitversion(repository_folder)
3309
+ changelog_file = os.path.join(repository_folder, "Other", "Resources", "Changelog", f"v{current_version}.md")
3310
+ if (not os.path.isfile(changelog_file)):
3311
+ GeneralUtilities.ensure_file_exists(changelog_file)
3312
+ GeneralUtilities.write_text_to_file(changelog_file, """# Release notes
3313
+
3314
+ ## Changes
3315
+
3316
+ - Updated geo-ip-database.
3317
+ """)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.105
3
+ Version: 3.5.106
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Home-page: https://github.com/anionDev/ScriptCollection
6
6
  Author: Marius Göcke
@@ -1,16 +1,16 @@
1
1
  ScriptCollection/Executables.py,sha256=HI9Pxs5Z9QxPGyqeJU2lWslEggFyGYANCqYVQZp6eJ0,30490
2
- ScriptCollection/GeneralUtilities.py,sha256=jkJu6y8Wv-j_braS_0zsjF6JzDo46NshMeeAphsXGX4,43848
2
+ ScriptCollection/GeneralUtilities.py,sha256=rjOHLJXHQtYCDSjjWQ45Vs7vzm9C2lEgtyYQ_91TEHU,44043
3
3
  ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
4
4
  ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4bQNM6RV6Y,2480
5
5
  ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
6
6
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
7
7
  ScriptCollection/SCLog.py,sha256=Gw27Oclcb0ten7_89PD5CdNMoO-at2hGUOYbF-x1HPQ,2296
8
- ScriptCollection/ScriptCollectionCore.py,sha256=U4kI7ztIm6_KL4FFRmway_y8QRrQiJgFEZTBzZ618Ys,126071
9
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=iemQ1J0UAengGAvCTJdc8-ipjhfLqf0Su8evQTDdLGU,231626
8
+ ScriptCollection/ScriptCollectionCore.py,sha256=w5AmB7nLdcgRu5kqfHls95046uRQHqLvWMsywZX4yMA,126071
9
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=9rO_W6kZiy3Lgov0HeyyDhOwriorMeJXlVDvwZ3S1UE,232511
10
10
  ScriptCollection/UpdateCertificates.py,sha256=xRebqD2etBD7ILHL-7fg-Y-kPF0Tbmnwexv4FhwDntQ,7791
11
11
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- scriptcollection-3.5.105.dist-info/METADATA,sha256=BK_ZzXAIr0w33y_eYM1aDhSh24Po6Mb26eXLacXe1ns,7664
13
- scriptcollection-3.5.105.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
14
- scriptcollection-3.5.105.dist-info/entry_points.txt,sha256=fYCGWGNGijBQHhFe6UAO-BEpfEOxLyNJemukt5ElSzs,3644
15
- scriptcollection-3.5.105.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
- scriptcollection-3.5.105.dist-info/RECORD,,
12
+ scriptcollection-3.5.106.dist-info/METADATA,sha256=n6LYf8sPb9QA50YUjdHf3Sx-ShX9J-_mjl4eJ4RZp4g,7664
13
+ scriptcollection-3.5.106.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
14
+ scriptcollection-3.5.106.dist-info/entry_points.txt,sha256=fYCGWGNGijBQHhFe6UAO-BEpfEOxLyNJemukt5ElSzs,3644
15
+ scriptcollection-3.5.106.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
+ scriptcollection-3.5.106.dist-info/RECORD,,