ScriptCollection 3.5.55__py3-none-any.whl → 3.5.57__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.
@@ -480,3 +480,12 @@ def RemoveFolder() -> int:
480
480
  GeneralUtilities.write_exception_to_stderr("This function is not implemented yet.")
481
481
  # TODO implement function
482
482
  return 1
483
+
484
+
485
+ def Rename() -> int:
486
+ parser = argparse.ArgumentParser(description="This function renames a file or folder.")
487
+ parser.add_argument('-s', '--source', required=True)
488
+ parser.add_argument('-t', '--target', required=True)
489
+ args = parser.parse_args()
490
+ os.rename(args.source, args.target)
491
+ return 0
@@ -31,7 +31,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
31
31
  from .ProgramRunnerPopen import ProgramRunnerPopen
32
32
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
33
33
 
34
- version = "3.5.55"
34
+ version = "3.5.57"
35
35
  __version__ = version
36
36
 
37
37
 
@@ -612,9 +612,9 @@ class ScriptCollectionCore:
612
612
  @GeneralUtilities.check_arguments
613
613
  def is_file(self, path: str) -> bool:
614
614
  if self.program_runner.will_be_executed_locally():
615
- return os.path.isfile(path) # much more performant than always running an external program
615
+ return os.path.isfile(path) # works only locally, but much more performant than always running an external program
616
616
  else:
617
- exit_code, _, stderr = self.run_program("scfileexists", ["--path", path], throw_exception_if_exitcode_is_not_zero=False) # works platform-indepent
617
+ exit_code, _, stderr, _ = self.run_program_argsasarray("scfileexists", ["--path", path], throw_exception_if_exitcode_is_not_zero=False) # works platform-indepent
618
618
  if exit_code == 0:
619
619
  return True
620
620
  elif exit_code == 1:
@@ -625,10 +625,10 @@ class ScriptCollectionCore:
625
625
 
626
626
  @GeneralUtilities.check_arguments
627
627
  def is_folder(self, path: str) -> bool:
628
- if self.program_runner.will_be_executed_locally(): # much more performant than always running an external program
628
+ if self.program_runner.will_be_executed_locally(): # works only locally, but much more performant than always running an external program
629
629
  return os.path.isdir(path)
630
630
  else:
631
- exit_code, _, stderr = self.run_program("scfolderexists", ["--path", path], throw_exception_if_exitcode_is_not_zero=False) # works platform-indepent
631
+ exit_code, _, stderr, _ = self.run_program_argsasarray("scfolderexists", ["--path", path], throw_exception_if_exitcode_is_not_zero=False) # works platform-indepent
632
632
  if exit_code == 0:
633
633
  return True
634
634
  elif exit_code == 1:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ScriptCollection
3
- Version: 3.5.55
3
+ Version: 3.5.57
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
- ScriptCollection/Executables.py,sha256=YMPkCwR4xfurYWQ2l2WcipO0hMNO2VB9ygKZsAvk5wc,24273
1
+ ScriptCollection/Executables.py,sha256=j79qOgjHKgha2EW1uMfKf1Woa6rsChL0yqJgIA-YkYU,24586
2
2
  ScriptCollection/GeneralUtilities.py,sha256=OhxbpAa_0fTLCaVJo2KBXSxwNhZU1QoO1So5QJoNVkw,38602
3
3
  ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
4
4
  ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4bQNM6RV6Y,2480
5
5
  ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
6
6
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
7
7
  ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
8
- ScriptCollection/ScriptCollectionCore.py,sha256=e2-Csid-AKc39trT6jVR1fU9DrNHuq8iE7dRRw2UTP0,111102
8
+ ScriptCollection/ScriptCollectionCore.py,sha256=Bn2chUJ4TOJyyaMg2tZD86Oa0ZeLcz4quGw8bs3ziMw,111180
9
9
  ScriptCollection/TasksForCommonProjectStructure.py,sha256=SaX_1ulRQLmO7FzRsIMPXKq48Z7hFYuRJVLi3aJHRj8,212976
10
10
  ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
11
11
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- ScriptCollection-3.5.55.dist-info/METADATA,sha256=msJci7lCJUbXECRyPwgcN4xLXQPuVQ36g_Sc-pSERo4,7664
13
- ScriptCollection-3.5.55.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
- ScriptCollection-3.5.55.dist-info/entry_points.txt,sha256=FQ6G7VA5YX6TmEqcZD8BA-2dYRAw8Y4C5Ckl1QET95c,3145
15
- ScriptCollection-3.5.55.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
- ScriptCollection-3.5.55.dist-info/RECORD,,
12
+ ScriptCollection-3.5.57.dist-info/METADATA,sha256=6t-Uzik1zqd8vtcodANtoQHCQrImxc_U907PSAI9XFM,7664
13
+ ScriptCollection-3.5.57.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
+ ScriptCollection-3.5.57.dist-info/entry_points.txt,sha256=AQz2mMJ787Aw5Q_ItC6Q-Mo_DGYlM_OPEkovrgsrRF0,3192
15
+ ScriptCollection-3.5.57.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
+ ScriptCollection-3.5.57.dist-info/RECORD,,
@@ -35,6 +35,7 @@ scprintfilesize = ScriptCollection.Executables:PrintFileSize
35
35
  scregexreplaceinfile = ScriptCollection.Executables:RegexReplaceInFile
36
36
  scremoveFolder = ScriptCollection.Executables:RemoveFolder
37
37
  scremovefile = ScriptCollection.Executables:RemoveFile
38
+ screname = ScriptCollection.Executables:Rename
38
39
  screplacesubstringsinfilenames = ScriptCollection.Executables:ReplaceSubstringsInFilenames
39
40
  scsearchinfiles = ScriptCollection.Executables:SearchInFiles
40
41
  scsetcontentoffile = ScriptCollection.Executables:SetContentOfFile