ScriptCollection 3.5.24__py3-none-any.whl → 3.5.25__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.
@@ -4,6 +4,7 @@ import json
4
4
  import binascii
5
5
  import filecmp
6
6
  import hashlib
7
+ import multiprocessing
7
8
  import time
8
9
  from io import BytesIO
9
10
  import itertools
@@ -30,7 +31,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
30
31
  from .ProgramRunnerPopen import ProgramRunnerPopen
31
32
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
32
33
 
33
- version = "3.5.24"
34
+ version = "3.5.25"
34
35
  __version__ = version
35
36
 
36
37
 
@@ -1072,7 +1073,7 @@ class ScriptCollectionCore:
1072
1073
  @GeneralUtilities.check_arguments
1073
1074
  def get_docker_debian_version(self, image_tag: str) -> str:
1074
1075
  result = ScriptCollectionCore().run_program_argsasarray("docker", ['run', f'debian:{image_tag}', 'bash', '-c', 'apt-get -y update && apt-get -y install lsb-release && lsb_release -cs'])
1075
- result_line = GeneralUtilities.string_to_lines(result[1])[-2]
1076
+ result_line = GeneralUtilities.string_to_lines(result[1])[-1]
1076
1077
  return result_line
1077
1078
 
1078
1079
  @GeneralUtilities.check_arguments
@@ -1870,3 +1871,17 @@ TXDX
1870
1871
  - [QualityCheck-system](TXDX)
1871
1872
 
1872
1873
  """)
1874
+
1875
+ @GeneralUtilities.check_arguments
1876
+ def run_with_timeout(self, method, timeout_in_seconds: float) -> bool:
1877
+ # Returns true if the method was terminated due to a timeout
1878
+ # Returns false if the method terminates in the given time
1879
+ p = multiprocessing.Process(target=method)
1880
+ p.start()
1881
+ p.join(timeout_in_seconds)
1882
+ if p.is_alive():
1883
+ p.kill()
1884
+ p.join()
1885
+ return True
1886
+ else:
1887
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ScriptCollection
3
- Version: 3.5.24
3
+ Version: 3.5.25
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
@@ -5,12 +5,12 @@ ScriptCollection/ProgramRunnerBase.py,sha256=7QAjoqOz6XPmJH19F2k-Z1fFQB_uZnPFvn-
5
5
  ScriptCollection/ProgramRunnerEpew.py,sha256=C2Rs3YWOWWWJct7XmKphp5CF1tf0j4Fp-ljV2drLTfs,6349
6
6
  ScriptCollection/ProgramRunnerPopen.py,sha256=G3LgQUVCfaq7XjBsGzalElH31Hbr0etttGR2_H87YzA,3512
7
7
  ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
8
- ScriptCollection/ScriptCollectionCore.py,sha256=n3ealK4b0pLWoqRSgdWiFDuSPbG-ZzSAedPqF2cyEOE,100571
8
+ ScriptCollection/ScriptCollectionCore.py,sha256=QkSVb1Ehol4v-13QRK44aQcGbvWG8O4H0wW5OUm86B0,101078
9
9
  ScriptCollection/TasksForCommonProjectStructure.py,sha256=2s_oiUzfcBgKWc33kYphcqDlfdnwpYkn8oCUxKeWmhc,193504
10
10
  ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
11
11
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- ScriptCollection-3.5.24.dist-info/METADATA,sha256=CwcFBnSIeqIYzTRMSCzdMS1VQTwzqbP0013R3SPEM-M,7684
13
- ScriptCollection-3.5.24.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
14
- ScriptCollection-3.5.24.dist-info/entry_points.txt,sha256=yASwR6hWZ_b5d4W49YeX1htD8ngfWbwgjpfQiJdtUAU,2322
15
- ScriptCollection-3.5.24.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
- ScriptCollection-3.5.24.dist-info/RECORD,,
12
+ ScriptCollection-3.5.25.dist-info/METADATA,sha256=Yj0rW-8rdvEl6z12x6uLz3MIiTt4xOWVwZchFUOQMnM,7684
13
+ ScriptCollection-3.5.25.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
14
+ ScriptCollection-3.5.25.dist-info/entry_points.txt,sha256=yASwR6hWZ_b5d4W49YeX1htD8ngfWbwgjpfQiJdtUAU,2322
15
+ ScriptCollection-3.5.25.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
+ ScriptCollection-3.5.25.dist-info/RECORD,,