ScriptCollection 4.2.56__py3-none-any.whl → 4.2.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.
- ScriptCollection/ScriptCollectionCore.py +23 -5
- ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py +1 -1
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +2 -2
- {scriptcollection-4.2.56.dist-info → scriptcollection-4.2.57.dist-info}/METADATA +2 -2
- {scriptcollection-4.2.56.dist-info → scriptcollection-4.2.57.dist-info}/RECORD +8 -8
- {scriptcollection-4.2.56.dist-info → scriptcollection-4.2.57.dist-info}/WHEEL +0 -0
- {scriptcollection-4.2.56.dist-info → scriptcollection-4.2.57.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.2.56.dist-info → scriptcollection-4.2.57.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,6 @@ import json
|
|
|
3
3
|
import binascii
|
|
4
4
|
import filecmp
|
|
5
5
|
import hashlib
|
|
6
|
-
import logging
|
|
7
6
|
import multiprocessing
|
|
8
7
|
import time
|
|
9
8
|
from io import BytesIO
|
|
@@ -37,7 +36,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
37
36
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
38
37
|
from .SCLog import SCLog, LogLevel
|
|
39
38
|
|
|
40
|
-
version = "4.2.
|
|
39
|
+
version = "4.2.57"
|
|
41
40
|
__version__ = version
|
|
42
41
|
|
|
43
42
|
class VSCodeWorkspaceShellTask:
|
|
@@ -2880,7 +2879,7 @@ OCR-content:
|
|
|
2880
2879
|
lines=program_result[1].split("\n")[1:]
|
|
2881
2880
|
for line in lines:
|
|
2882
2881
|
splitted=[item for item in line.split(' ') if GeneralUtilities.string_has_content(item)]
|
|
2883
|
-
result.append(splitted[1])
|
|
2882
|
+
result.append(splitted[1].replace("\n","").replace("\r","").strip())
|
|
2884
2883
|
return result
|
|
2885
2884
|
|
|
2886
2885
|
@GeneralUtilities.check_arguments
|
|
@@ -3185,7 +3184,7 @@ OCR-content:
|
|
|
3185
3184
|
"target": target_language,
|
|
3186
3185
|
"format": "text"
|
|
3187
3186
|
}
|
|
3188
|
-
response = requests.post(url, json=payload)
|
|
3187
|
+
response = requests.post(url, json=payload, timeout=30)
|
|
3189
3188
|
response.raise_for_status()
|
|
3190
3189
|
return response.json()["translatedText"]
|
|
3191
3190
|
|
|
@@ -3194,9 +3193,28 @@ OCR-content:
|
|
|
3194
3193
|
"""Detects the language of the given text using the LibreTranslate API."""
|
|
3195
3194
|
url = f"{libre_translate_api_server.rstrip('/')}/detect"
|
|
3196
3195
|
payload = {"q": content}
|
|
3197
|
-
response = requests.post(url, json=payload)
|
|
3196
|
+
response = requests.post(url, json=payload, timeout=30)
|
|
3198
3197
|
response.raise_for_status()
|
|
3199
3198
|
results = response.json()
|
|
3200
3199
|
if not results:
|
|
3201
3200
|
raise ValueError("Language detection returned no results.")
|
|
3202
3201
|
return results[0]["language"]
|
|
3202
|
+
|
|
3203
|
+
@GeneralUtilities.check_arguments
|
|
3204
|
+
def get_all_files_in_git_repository(self,repository_folder:str,include_submodules: bool = True) -> list[str]:
|
|
3205
|
+
"""returns all files in a git-repository except ignored files"""
|
|
3206
|
+
cmd = ["ls-files", "--cached", "--exclude-standard"]
|
|
3207
|
+
if include_submodules:
|
|
3208
|
+
cmd.append("--recurse-submodules")
|
|
3209
|
+
output=self.run_program_argsasarray("git", cmd,repository_folder)
|
|
3210
|
+
files = [ GeneralUtilities.normalize_path("./" + line) for line in output[1].splitlines()if line.strip() ]
|
|
3211
|
+
return files
|
|
3212
|
+
|
|
3213
|
+
@GeneralUtilities.check_arguments
|
|
3214
|
+
def write_file_list_for_repository(self,repository_folder:str,target_file:str="./FileList.txt") -> None:
|
|
3215
|
+
if os.path.isabs(target_file):
|
|
3216
|
+
target_file=GeneralUtilities.resolve_relative_path(target_file,repository_folder)
|
|
3217
|
+
target_file=GeneralUtilities.normalize_path(target_file)
|
|
3218
|
+
files=self.get_all_files_in_git_repository(repository_folder)
|
|
3219
|
+
GeneralUtilities.ensure_file_exists(target_file)
|
|
3220
|
+
GeneralUtilities.write_lines_to_file(target_file, files)
|
|
@@ -192,8 +192,8 @@ class TFCPS_CodeUnitSpecific_NodeJS_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
192
192
|
|
|
193
193
|
@GeneralUtilities.check_arguments
|
|
194
194
|
def organize_translations(self,languages:list[str])->None:
|
|
195
|
-
self.__ensure_translations_exist(languages)
|
|
196
195
|
self._protected_sc.run_with_epew("npm","run extract-translations",self.get_codeunit_folder())
|
|
196
|
+
self.__ensure_translations_exist(languages)
|
|
197
197
|
self._protected_sc.sync_xlf2_files("messages",languages,os.path.join(self.get_codeunit_folder(),"Other","Resources","Translations"))
|
|
198
198
|
|
|
199
199
|
@GeneralUtilities.check_arguments
|
|
@@ -726,7 +726,7 @@ class TFCPS_Tools_General:
|
|
|
726
726
|
if generate_certificate:
|
|
727
727
|
self.__sc.generate_certificate_authority(ca_folder, ca_name, "DE", "SubjST", "SubjL", "SubjO", "SubjOU")
|
|
728
728
|
# TODO add switch to auto-install the script if desired
|
|
729
|
-
# for windows: powershell Import-Certificate -FilePath
|
|
729
|
+
# for windows: powershell Import-Certificate -FilePath MyProjectCA_20241121000236.crt -CertStoreLocation 'Cert:\CurrentUser\Root'
|
|
730
730
|
# for linux: (TODO)
|
|
731
731
|
|
|
732
732
|
@GeneralUtilities.check_arguments
|
|
@@ -1433,7 +1433,7 @@ class TFCPS_Tools_General:
|
|
|
1433
1433
|
def download_file(self,source:str,target:str):
|
|
1434
1434
|
GeneralUtilities.ensure_directory_exists(os.path.dirname(target))
|
|
1435
1435
|
GeneralUtilities.ensure_file_exists(target)
|
|
1436
|
-
response = requests.get(source)
|
|
1436
|
+
response = requests.get(source, timeout=30)
|
|
1437
1437
|
response.raise_for_status()
|
|
1438
1438
|
with open(target, "wb") as f:
|
|
1439
1439
|
f.write(response.content)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ScriptCollection
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.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
|
|
@@ -33,7 +33,7 @@ Requires-Dist: ntplib>=0.4.0
|
|
|
33
33
|
Requires-Dist: Pillow>=11.3.0
|
|
34
34
|
Requires-Dist: psutil>=7.2.2
|
|
35
35
|
Requires-Dist: pycdlib>=1.14.0
|
|
36
|
-
Requires-Dist: Pygments>=2.
|
|
36
|
+
Requires-Dist: Pygments>=2.20.0
|
|
37
37
|
Requires-Dist: pylint>=4.0.5
|
|
38
38
|
Requires-Dist: pyOpenSSL>=25.3.0
|
|
39
39
|
Requires-Dist: PyPDF>=6.9.2
|
|
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
|
|
|
9
9
|
ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
|
|
10
10
|
ScriptCollection/ProgramRunnerSudo.py,sha256=_khC3xuTdrPoLluBJZWfldltmmuKltABJPcbjZSFW-4,4835
|
|
11
11
|
ScriptCollection/SCLog.py,sha256=8TRy1LeYMsPOIuWUcnUNNbO5pd-cNBS-3cn-kdzP8FU,4768
|
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=jjGd7cbFB-FpsXsymVoFcF_M9wXIZ2AIttcRfiXl8IU,174895
|
|
13
13
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=83qDMILwxhH9DbC0sb358Vu8PXEysmJJyap_6gECZqs,1627
|
|
15
15
|
ScriptCollection/OCIImages/OCIImageManager.py,sha256=aBogkSXNDyi8NO11N-s03nuFJEv7PyJ-wjHuYYeZfvs,6662
|
|
@@ -30,7 +30,7 @@ ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=O-0guM_LJCcZmPZJhMgTvXD2RXUJEBWWv
|
|
|
30
30
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=-Ev9D3bZDlUk2WFQhcmvzQ3FCS97OdsVUd0koAdmpZc,7474
|
|
31
31
|
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=Ajfy2pLajTuU6UpwItHt4C2a-gLF3gPc4z6BktL3Cio,22163
|
|
32
32
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=f0Uq1cA_4LvmL72cal0crrbKF6PcxL13D9wBKuQ1YBw,2328
|
|
33
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
|
33
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=WV67pHLrhD_qEjUqM-8tUpEdhQ4brwVentfIf7AMOP4,93942
|
|
34
34
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=BPJkoy2KVgB_38cAk5qjM4s4FpJvOkTp467nrvANIIU,10606
|
|
36
36
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -43,12 +43,12 @@ ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=U8oBAOLR
|
|
|
43
43
|
ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
44
|
ScriptCollection/TFCPS/Go/TFCPS_CodeUnitSpecific_Go.py,sha256=kyx26AnT1-LySFA46wfJ9yZUKYdMWTD0U2XZfSQbuB0,3497
|
|
45
45
|
ScriptCollection/TFCPS/Go/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
|
-
ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=
|
|
46
|
+
ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=Kkyyof6DML7jUdES5GmIXQ_yVMJ1xnJbZmbIAqls3IE,11816
|
|
47
47
|
ScriptCollection/TFCPS/NodeJS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
48
|
ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=nLw_eSUd_56jjgfcAvtUyzecSZ14mYmNJl0iu-1YNVk,13496
|
|
49
49
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
-
scriptcollection-4.2.
|
|
51
|
-
scriptcollection-4.2.
|
|
52
|
-
scriptcollection-4.2.
|
|
53
|
-
scriptcollection-4.2.
|
|
54
|
-
scriptcollection-4.2.
|
|
50
|
+
scriptcollection-4.2.57.dist-info/METADATA,sha256=iMa7-_9uZdnhT-dv-aA7iTfCkOk5d8-Os0jqzuyFT1Y,7690
|
|
51
|
+
scriptcollection-4.2.57.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
52
|
+
scriptcollection-4.2.57.dist-info/entry_points.txt,sha256=27XwAJEcaMEc1be0Ec1vKHCbiU4Ziu8jKL-SqsrYOIQ,4680
|
|
53
|
+
scriptcollection-4.2.57.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
54
|
+
scriptcollection-4.2.57.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|