ScriptCollection 4.2.39__py3-none-any.whl → 4.2.40__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.
@@ -25,5 +25,5 @@ class CultureChooser:
25
25
  GeneralUtilities.assert_condition(self.is_valid_culture(supported_language), f"Invalid language code '{supported_language}'. Supported languages must be in the format 'en' or 'en-US'.")
26
26
  content = GeneralUtilities._internal_load_resource("CultureChooser/index.html")
27
27
  content_as_string = content.decode("utf-8")
28
- result=GeneralUtilities.replace_variable("/*","supportedCultures","*/", ",".join([f"\"{supported_language}\"" for supported_language in supported_languages]), content_as_string)
28
+ result=GeneralUtilities.replace_variable("/*","supportedCultures","*/", ", ".join([f"\"{supported_language}\"" for supported_language in supported_languages]), content_as_string)
29
29
  return result
@@ -654,10 +654,12 @@ def Espoc() -> int:
654
654
  time.sleep(1)
655
655
  GeneralUtilities.write_message_to_stdout(f"Process with id {process_id} is not running anymore. Start terminating remaining processes.")
656
656
  if os.path.exists(process_list_file):
657
- for line in GeneralUtilities.read_lines_from_file(process_list_file):
658
- if GeneralUtilities.string_has_content(line):
659
- current_process_id = int(line.strip())
657
+ for line in GeneralUtilities.read_nonempty_lines_from_file(process_list_file):
658
+ current_process_id = int(line.strip())
659
+ try:
660
660
  GeneralUtilities.kill_process(current_process_id, True)
661
+ except Exception as exception:
662
+ GeneralUtilities.write_exception_to_stderr(exception,"Error while terminating process with id "+str(current_process_id))
661
663
  GeneralUtilities.ensure_file_does_not_exist(process_list_file)
662
664
  GeneralUtilities.write_message_to_stdout("All started processes terminated.")
663
665
  else:
@@ -4,9 +4,7 @@ function getBrowserCulture() {
4
4
  return match ? match[0] : "en";
5
5
  }
6
6
  function redirectToCulture() {
7
- const supportedCultures = [
8
- /*__supportedCultures__*/
9
- ];
7
+ const supportedCultures = [ /*__supportedCultures__*/];
10
8
 
11
9
  let culture = getBrowserCulture();
12
10
  if (supportedCultures.includes(culture)) {
@@ -1,3 +1,4 @@
1
+ <!DOCTYPE html>
1
2
  <html>
2
3
 
3
4
  <head>
@@ -6,7 +7,9 @@
6
7
  </head>
7
8
 
8
9
  <body>
10
+ <h1><!--__title__--></h1>
9
11
  <script src="./CultureChooser.js"></script>
12
+ If you are not redirected, click <a href="/en/">here</a>.
10
13
  </body>
11
14
 
12
15
  </html>
@@ -35,7 +35,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
35
35
  from .ProgramRunnerPopen import ProgramRunnerPopen
36
36
  from .SCLog import SCLog, LogLevel
37
37
 
38
- version = "4.2.39"
38
+ version = "4.2.40"
39
39
  __version__ = version
40
40
 
41
41
 
@@ -2783,3 +2783,16 @@ OCR-content:
2783
2783
  #TODO add cli-script to call this function
2784
2784
  if network_name in self.get_docker_networks():
2785
2785
  self.run_program("docker",f"network rm {network_name}")
2786
+
2787
+ @GeneralUtilities.check_arguments
2788
+ def get_available_cultures_for_angular_app(self,angular_json_file:str)->list[str]:
2789
+ languages = ["en"]
2790
+ with open(angular_json_file, "r", encoding="utf-8") as f:
2791
+ data = json.load(f)
2792
+ for project in data.get("projects", {}).values():
2793
+ i18n = project.get("i18n", {})
2794
+ locales = i18n.get("locales", {})
2795
+ languages.extend(locales.keys())
2796
+
2797
+ languages=list(languages)
2798
+ return languages
@@ -137,8 +137,12 @@ class TFCPS_CodeUnitSpecific_NodeJS_Functions(TFCPS_CodeUnitSpecific_Base):
137
137
  cc_script_content=cc.get_culture_chooser_script(supported_cultures)
138
138
  GeneralUtilities.write_text_to_file(cc_script_file, cc_script_content)
139
139
 
140
+ @GeneralUtilities.check_arguments
141
+ def get_available_cultures_for_angular_app(self)->None:
142
+ return self._protected_sc.get_available_cultures_for_angular_app(self.get_codeunit_folder()+"/angular.json")
143
+
140
144
  class TFCPS_CodeUnitSpecific_NodeJS_CLI:
141
-
145
+
142
146
  @staticmethod
143
147
  @GeneralUtilities.check_arguments
144
148
  def parse(file:str)->TFCPS_CodeUnitSpecific_NodeJS_Functions:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 4.2.39
3
+ Version: 4.2.40
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,7 +1,7 @@
1
1
  ScriptCollection/AnionBuildPlatform.py,sha256=Sw35p6gKZ4qjvaDWtrnWW3iCHdUpHSUjtq5tc2iL_AI,11522
2
2
  ScriptCollection/CertificateUpdater.py,sha256=aCBF-bym5renP5joL32ev7WZW8HHh6hNm_mz6_hQKLc,9617
3
- ScriptCollection/CultureChooser.py,sha256=pCA2Ar825TSTIF3ar1mvxY-H-nbbdK4wPdY_Kut496I,1645
4
- ScriptCollection/Executables.py,sha256=Xlz80hW7HxF0JUoRsAgNc1txSFOE88JCiGMPry90BRs,43234
3
+ ScriptCollection/CultureChooser.py,sha256=a-ahVmJA7Xa7wT5S4keEM4j5ZdahvlesGd7tzBocaoM,1646
4
+ ScriptCollection/Executables.py,sha256=zP8EUkcl5q31AwHdYrADQRru2Wxwv2m67O-3m6PoGbs,43378
5
5
  ScriptCollection/GeneralUtilities.py,sha256=ymXpj4eb2WUjMlG8O3sJP_09x0qQYReS-IKqFvMI57U,58081
6
6
  ScriptCollection/ImageUpdater.py,sha256=fxyz3oZkKlqyieYiyj0Yi1dQjOJEuHhu0WvL_JHsB90,38905
7
7
  ScriptCollection/ProcessesRunner.py,sha256=o5raxIt3lknNPoPrjNzJ2bprRPJ3SnL0rrR7crraD7E,1523
@@ -10,7 +10,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
10
10
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
11
11
  ScriptCollection/ProgramRunnerSudo.py,sha256=_khC3xuTdrPoLluBJZWfldltmmuKltABJPcbjZSFW-4,4835
12
12
  ScriptCollection/SCLog.py,sha256=8TRy1LeYMsPOIuWUcnUNNbO5pd-cNBS-3cn-kdzP8FU,4768
13
- ScriptCollection/ScriptCollectionCore.py,sha256=MKwHzCwhKWJ24edTSNcxEpykTQStKOZniJ2841kUKPg,156254
13
+ ScriptCollection/ScriptCollectionCore.py,sha256=c95wW7QRfMvGsYn8pqGaEjYoo-6QLvC9LA59mqHLGdU,156756
14
14
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=Pa72cRybzBroy-OzzxZqKpFB58iY2kcf5yFfIAIPfXk,1627
16
16
  ScriptCollection/OCIImages/OCIImageManager.py,sha256=xTYnj68CRDkTjJiibSov1HSI0djmmcY6mwP6_fD0kCM,7141
@@ -20,8 +20,8 @@ ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebianSlim.py,sha25
20
20
  ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGeneric.py,sha256=xyE4wYK6s17NrBJiat1ohMKlTjygC402QIUwvFNf0ao,604
21
21
  ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGenericV.py,sha256=T5vMwIDFEpm6JzSJVS2oRnc2Z7QbPWonld0LEUpHoMg,605
22
22
  ScriptCollection/OCIImages/ConcreteImageHandlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- ScriptCollection/Resources/CultureChooser/CultureChooser.js,sha256=Yp1GnWDjOGFl7hPeJ-GYi0co8g2Hqhdad7hon2dyUAE,689
24
- ScriptCollection/Resources/CultureChooser/index.html,sha256=HXjcH_ffV25GCcy6j7iV5FvzeWUtltXDibQNZOdpgbc,158
23
+ ScriptCollection/Resources/CultureChooser/CultureChooser.js,sha256=AyiswZ50WLVIY0-mojaCrWOr4VloBWZjQNWoALDohNw,676
24
+ ScriptCollection/Resources/CultureChooser/index.html,sha256=v3GzjP2d7W93jqJB-bG6gtfQrj0q-2vPdm5fsDbiO0k,266
25
25
  ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=xpt-Z_jztEaKgpT1DDSX7wezWX0VKS5LQb7IKAzvi4U,27860
26
26
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=vnNrwvNePvW2dQhnSusBjgvOssI3a1P3g94bNxNIr3o,8069
27
27
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=YfyO1aSBnlKOpzEkqya0rLXQmZ3gw-mdwUqSXVQBbRE,14918
@@ -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=y028-yM3D1B9zZAnt2wUzzvGRpU1_nXuQTV4FaaP524,7982
46
+ ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=j32QNGkIsoXw3TUqY6p9Jc7B1D4iO-e3LG3C1ihg2nk,8205
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.39.dist-info/METADATA,sha256=i-bDq9V6uy8-tnwiXn4S4bWTXldedh-d9ESHK38_6IU,7690
51
- scriptcollection-4.2.39.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
52
- scriptcollection-4.2.39.dist-info/entry_points.txt,sha256=m_HqkdaPXThWnd2chMMhs8dA5aRJu1ifrcwUnvw5SBE,4572
53
- scriptcollection-4.2.39.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
54
- scriptcollection-4.2.39.dist-info/RECORD,,
50
+ scriptcollection-4.2.40.dist-info/METADATA,sha256=_6tAPN3GrwkT4KMh6GKUGsIvFPTaKpdtlDVLSG1H3Ps,7690
51
+ scriptcollection-4.2.40.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
52
+ scriptcollection-4.2.40.dist-info/entry_points.txt,sha256=m_HqkdaPXThWnd2chMMhs8dA5aRJu1ifrcwUnvw5SBE,4572
53
+ scriptcollection-4.2.40.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
54
+ scriptcollection-4.2.40.dist-info/RECORD,,