ScriptCollection 4.2.149__py3-none-any.whl → 4.2.150__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.
@@ -3,6 +3,7 @@ import os
3
3
  from os import listdir
4
4
  from os.path import isfile, join, isdir
5
5
  import platform
6
+ import tempfile
6
7
  import json
7
8
  import inspect
8
9
  import ctypes
@@ -1161,6 +1162,21 @@ class GeneralUtilities:
1161
1162
  def current_system_is_linux():
1162
1163
  return platform.system() == 'Linux'
1163
1164
 
1165
+ @staticmethod
1166
+ def get_temp_folder() -> str:
1167
+ """Returns an absolute path to the system-temp-folder. Use this instead of tempfile.gettempdir() directly:
1168
+ in some Linux-build-containers TMPDIR/TEMP/TMP is set to a relative value, which makes tempfile.gettempdir()
1169
+ return a relative path. A relative temp-path would create temp-content relative to the current working-directory
1170
+ (e.g. inside a codeunit-folder) and would not be cleaned up reliably. In that case the platform-default absolute
1171
+ temp-folder is used instead."""
1172
+ temp_folder = tempfile.gettempdir()
1173
+ if not os.path.isabs(temp_folder):
1174
+ if GeneralUtilities.current_system_is_windows():
1175
+ temp_folder = os.path.join(os.environ.get("SystemRoot", "C:\\Windows"), "Temp")
1176
+ else:
1177
+ temp_folder = "/tmp"
1178
+ return temp_folder
1179
+
1164
1180
  @staticmethod
1165
1181
  @check_arguments
1166
1182
  def get_line():
@@ -24,7 +24,6 @@ import shutil
24
24
  from typing import IO
25
25
  import fnmatch
26
26
  import uuid
27
- import tempfile
28
27
  import io
29
28
  import requests
30
29
  import ntplib
@@ -38,7 +37,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
38
37
  from .ProgramRunnerPopen import ProgramRunnerPopen
39
38
  from .SCLog import SCLog, LogLevel
40
39
 
41
- version = "4.2.149"
40
+ version = "4.2.150"
42
41
  __version__ = version
43
42
 
44
43
  class VSCodeWorkspaceShellTask:
@@ -2476,7 +2475,7 @@ DNS = {domain}
2476
2475
 
2477
2476
  # prepare
2478
2477
  GeneralUtilities.ensure_directory_exists(deb_output_folder)
2479
- temp_folder = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
2478
+ temp_folder = os.path.join(GeneralUtilities.get_temp_folder(), str(uuid.uuid4()))
2480
2479
  GeneralUtilities.ensure_directory_exists(temp_folder)
2481
2480
  bin_folder = binary_folder
2482
2481
  tool_content_folder_name = toolname+"Content"
@@ -3245,7 +3244,7 @@ OCR-content:
3245
3244
  override_services[service_name] = {"ports": [f"{exposed_port}:{exposed_port}" for exposed_port in exposed_ports]}
3246
3245
  if 0 == len(override_services):
3247
3246
  return GeneralUtilities.empty_string
3248
- override_file = os.path.join(tempfile.gettempdir(), f"docker-compose.localhost.{str(uuid.uuid4())}.yml")
3247
+ override_file = os.path.join(GeneralUtilities.get_temp_folder(), f"docker-compose.localhost.{str(uuid.uuid4())}.yml")
3249
3248
  with open(override_file, "w", encoding="utf-8") as stream:
3250
3249
  yaml.safe_dump({"services": override_services}, stream)
3251
3250
  return override_file
@@ -1,7 +1,6 @@
1
1
  import os
2
2
  import re
3
3
  import shutil
4
- import tempfile
5
4
  import uuid
6
5
  import json
7
6
  import csv
@@ -290,7 +289,7 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
290
289
  codeunit_name = self.get_codeunit_name()
291
290
  codeunit_folder = self.get_codeunit_folder()
292
291
  sln_file = os.path.join(codeunit_folder, codeunit_name + ".sln")
293
- temp_output_folder = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
292
+ temp_output_folder = os.path.join(GeneralUtilities.get_temp_folder(), str(uuid.uuid4()))
294
293
  GeneralUtilities.ensure_directory_exists(temp_output_folder)
295
294
  try:
296
295
  run_result = self._protected_sc.run_program("dotnet", f"build \"{sln_file}\" -nologo -v minimal -o \"{temp_output_folder}\"", codeunit_folder, throw_exception_if_exitcode_is_not_zero=False, env_vars={"DOTNET_CLI_UI_LANGUAGE": "en-US"})
@@ -556,7 +555,7 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
556
555
 
557
556
  repository_folder: str = self.get_repository_folder().replace("\\", "/")
558
557
  coverage_file_folder = os.path.join(repository_folder, codeunit_name, "Other/Artifacts/TestCoverage")
559
- temp_folder = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
558
+ temp_folder = os.path.join(GeneralUtilities.get_temp_folder(), str(uuid.uuid4()))
560
559
  GeneralUtilities.ensure_directory_exists(temp_folder)
561
560
  runsettings_file = "runsettings.xml"
562
561
  codeunit_folder = f"{repository_folder}/{codeunit_name}"
@@ -63,7 +63,7 @@ class TFCPS_CodeUnitSpecific_Python_Functions(TFCPS_CodeUnitSpecific_Base):
63
63
  tests_folder = src_folder+"Tests"
64
64
  # The codeunit gets linted in an isolated folder which only contains this codeunit. This is required because otherwise sibling-codeunit-source-folders of the repository would shadow the installed dependency-packages of the same name during pylint's import-resolution (pylint adds the repository-folder to sys.path due to the package-nesting), which would result in false-positive import-errors. In the isolated folder the declared (and installed) dependency-codeunits are resolved instead.
65
65
  ignored_subfolders = ["Other", "__pycache__", "*.egg-info", "build", "dist", "venv", ".venv", ".pytest_cache", ".git"]
66
- with tempfile.TemporaryDirectory() as isolation_folder:
66
+ with tempfile.TemporaryDirectory(dir=GeneralUtilities.get_temp_folder()) as isolation_folder:
67
67
  isolated_codeunit_folder = os.path.join(isolation_folder, codeunitname)
68
68
  GeneralUtilities.copy_content_of_folder(codeunit_folder, isolated_codeunit_folder, ignored_glob_patterms=ignored_subfolders)
69
69
  pylint_configuration_file = os.path.join(repository_folder, ".pylintrc")
@@ -10,7 +10,6 @@ import time
10
10
  import re
11
11
  import sys
12
12
  import json
13
- import tempfile
14
13
  import uuid
15
14
  import urllib.request
16
15
  from packaging import version
@@ -534,7 +533,7 @@ class TFCPS_Tools_General:
534
533
  dst = "HEAD"
535
534
  dst_prefix = f"v{current_version}"
536
535
 
537
- temp_file = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
536
+ temp_file = os.path.join(GeneralUtilities.get_temp_folder(), str(uuid.uuid4()))
538
537
  try:
539
538
  GeneralUtilities.ensure_file_does_not_exist(temp_file)
540
539
  GeneralUtilities.write_text_to_file(temp_file, self.__sc.run_program("git", f'--no-pager diff --src-prefix={src_prefix}/ --dst-prefix={dst_prefix}/ {src} {dst} -- {codeunit_name}', repository_folder)[1])
@@ -755,7 +754,7 @@ class TFCPS_Tools_General:
755
754
  # Pin the font for all rendered diagrams via a PlantUML-config-file so the resulting SVG is identical across
756
755
  # machines, without having to add a skinparam to every (also hand-written) .plantuml-file. See the comment at
757
756
  # __default_diagram_font_name for the reason.
758
- font_config_file = os.path.join(tempfile.gettempdir(), f"plantuml-font-config-{uuid.uuid4()}.cfg")
757
+ font_config_file = os.path.join(GeneralUtilities.get_temp_folder(), f"plantuml-font-config-{uuid.uuid4()}.cfg")
759
758
  GeneralUtilities.write_text_to_file(font_config_file, f'skinparam defaultFontName "{TFCPS_Tools_General.__default_diagram_font_name}"')
760
759
  # Force the JVM to use the DejaVu-fonts bundled with ScriptCollection (via the font-path) instead of whatever
761
760
  # font-version happens to be installed on the host. This makes the text-measurement - and thus the resulting
@@ -787,7 +786,7 @@ class TFCPS_Tools_General:
787
786
  # GeneralUtilities._internal_load_resource so this also works when the package is stored as a zip-archive. Returns
788
787
  # None if the fonts are not available (e.g. an older installation without the bundled fonts). The caller is
789
788
  # responsible for removing the returned folder afterwards.
790
- temp_folder = os.path.join(tempfile.gettempdir(), f"scriptcollection-diagram-fonts-{uuid.uuid4()}")
789
+ temp_folder = os.path.join(GeneralUtilities.get_temp_folder(), f"scriptcollection-diagram-fonts-{uuid.uuid4()}")
791
790
  try:
792
791
  GeneralUtilities.ensure_directory_exists(temp_folder)
793
792
  for font_filename in TFCPS_Tools_General.__bundled_diagram_font_filenames:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.2.149
3
+ Version: 4.2.150
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
@@ -1,7 +1,7 @@
1
1
  ScriptCollection/AnionBuildPlatform.py,sha256=vg1lZ6D1nqq_mO7iYTDSktSImXd34scfPaXiIrbvrg0,11848
2
2
  ScriptCollection/CertificateUpdater.py,sha256=dR5JpJDlZdjD4_pgMz7zCrt1IM7VfatmK6pULSczxQw,9693
3
3
  ScriptCollection/Executables.py,sha256=O6REf3ricZVtAg-Z0isUxEpItqqH-pfIxK3BMfWMzaA,63861
4
- ScriptCollection/GeneralUtilities.py,sha256=cJK18rWzmVT3KyvjIAbPK4o4-jVPwYeuVpizbTHjBDc,68136
4
+ ScriptCollection/GeneralUtilities.py,sha256=NGJ1AQeP_dpRpLEW1XAguXOfffOhWZ9pEuE5LT4FSRA,69061
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
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
9
9
  ScriptCollection/ProgramRunnerPopen.py,sha256=8tP0xWKeRYoGlaNB3iUh4o61O-tKtcxrS7IUqtU85C4,4091
10
10
  ScriptCollection/ProgramRunnerSudo.py,sha256=RXsiceQ8W6a8YDk_2BPscVbIAmDIpIxqe9WHBy2r4CM,5233
11
11
  ScriptCollection/SCLog.py,sha256=Z-HhC_CRtU3HdQflNsabFh9IJOucHcXmxMDcf58fli0,4671
12
- ScriptCollection/ScriptCollectionCore.py,sha256=-dUlJZ9NhInlDw2CoT6q6OIO22f6z9hKjf4X5Bg4hVE,219953
12
+ ScriptCollection/ScriptCollectionCore.py,sha256=tUayYu1LUqz--x-oe2SXrSyeaCM2hFEvLkVNzmQwm9w,219962
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
@@ -40,14 +40,14 @@ ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=5vCFfDiU8bvfcnoKNs2ATS8nsl6mYXcIu
40
40
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=BsSV4a-NZY86MZ20d-_rYxNVAI4UzAfmEwXlRZ8qWQc,7685
41
41
  ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=QRm8n1qH8H_XbJhGCbzwdNr9KSEy0WkbG7ulpc4Md3U,22696
42
42
  ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=JYiDqDsfVJQWS9xWMi_UzfXnXsJRnPRxAzFr82bUEvI,2370
43
- ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=_L84d4krR2dlZBj1E1j3wsHu7fc01BDw_LfwKDmRjS4,126256
43
+ ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=HtIpLK9AaIzvLB_nOC8vPKosuwgi_7XV0xoZxut9AFs,126278
44
44
  ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
45
  ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=wS2yzYUmJ4m0cf6cBYVTHsiXSXfYhHoLFFy8x6yEQvY,19573
46
46
  ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
48
48
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
49
49
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
50
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=7TUqYQn_8VAkCirl4-z-3M1n76IW9AJcItVORjbjIas,41722
50
+ ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=7grKSK9qtYbpyvk3y7RsygBjmKQw1JlANSwk6GGmbBU,41731
51
51
  ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=KAjyFyEjpkghsVPskfsHD68k4Z92gRCT_q6BXfikRwE,7660
53
53
  ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -57,12 +57,12 @@ ScriptCollection/TFCPS/Maven/TFCPS_CodeUnitSpecific_Maven.py,sha256=WcWWtCV3GkAk
57
57
  ScriptCollection/TFCPS/Maven/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
58
  ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=i2msd3tmXaB8EWF3tIR5jwveIFlZcmeYXMde4UP32P4,14310
59
59
  ScriptCollection/TFCPS/NodeJS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
- ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=fqGhXNx8tK8sWPcn4D3eIE6gV9Oh7J37NBKjU089e-A,15852
60
+ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=Bd1gxCk9Fb6JO4XFk-sUWdn4bOvMJp1xpvN6wTKMh0Y,15890
61
61
  ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
63
63
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
- scriptcollection-4.2.149.dist-info/METADATA,sha256=YTb3K83KTUfTKLIM-nyxkG7naZTZDJHdFauxnvU7aDA,7817
65
- scriptcollection-4.2.149.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
66
- scriptcollection-4.2.149.dist-info/entry_points.txt,sha256=tXpgu2GUhY3yUmoK3gVPypYMnxorz3183wl82aFt7KI,5430
67
- scriptcollection-4.2.149.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
68
- scriptcollection-4.2.149.dist-info/RECORD,,
64
+ scriptcollection-4.2.150.dist-info/METADATA,sha256=yX5H1SZSpL_XbG6SPj_ydr7ErgFOoqMyzhyN9tI1X18,7817
65
+ scriptcollection-4.2.150.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
66
+ scriptcollection-4.2.150.dist-info/entry_points.txt,sha256=tXpgu2GUhY3yUmoK3gVPypYMnxorz3183wl82aFt7KI,5430
67
+ scriptcollection-4.2.150.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
68
+ scriptcollection-4.2.150.dist-info/RECORD,,