ScriptCollection 4.3.25__py3-none-any.whl → 4.3.26__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.
@@ -38,7 +38,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
38
38
  from .ProgramRunnerPopen import ProgramRunnerPopen
39
39
  from .SCLog import SCLog, LogLevel
40
40
 
41
- version = "4.3.25"
41
+ version = "4.3.26"
42
42
  __version__ = version
43
43
 
44
44
  class VSCodeWorkspaceShellTask:
@@ -541,8 +541,8 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
541
541
  return result
542
542
 
543
543
  @GeneralUtilities.check_arguments
544
- def generate_reference(self) -> None:
545
- self.generate_reference_using_docfx()
544
+ def generate_reference(self, generate_class_reference:bool=False) -> None:
545
+ self.generate_reference_using_docfx(generate_class_reference)
546
546
 
547
547
 
548
548
  @GeneralUtilities.check_arguments
@@ -5,6 +5,7 @@ import re
5
5
  import json
6
6
  import argparse
7
7
  from abc import ABC, abstractmethod
8
+ import yaml
8
9
  import xmlschema
9
10
  from packaging.version import Version
10
11
  from lxml import etree
@@ -247,8 +248,13 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
247
248
 
248
249
 
249
250
  @GeneralUtilities.check_arguments
250
- def generate_reference_using_docfx(self):
251
+ def generate_reference_using_docfx(self, generate_class_reference:bool=False):
251
252
  reference_folder =os.path.join( self.get_codeunit_folder(),"Other","Reference")
253
+ class_reference_folder:str=os.path.join(reference_folder,"ReferenceContent","API")
254
+ toc_md_file:str=os.path.join(class_reference_folder,"toc.md")
255
+ GeneralUtilities.ensure_file_does_not_exist(toc_md_file)#should not be available when docfx is runninng because then toc.html will be generated from toc.md but toc.html will be generated by docfx in the target-folder
256
+
257
+ self.tfcps_Tools_General.generate_svg_files_from_plantuml_files_for_codeunit(self.get_codeunit_folder(), self.use_cache())
252
258
  generated_reference_folder = GeneralUtilities.resolve_relative_path("../Artifacts/Reference", reference_folder)
253
259
  GeneralUtilities.ensure_directory_does_not_exist(generated_reference_folder)
254
260
  GeneralUtilities.ensure_directory_exists(generated_reference_folder)
@@ -257,6 +263,46 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
257
263
  self._protected_sc.run_program("docfx", "-t default,templates/darkfx docfx.json", reference_folder)
258
264
  GeneralUtilities.ensure_directory_does_not_exist(obj_folder)
259
265
 
266
+ if generate_class_reference:# this codeunit has a class-reference, so a human-readable table-of-content can be generated for it
267
+ GeneralUtilities.ensure_file_exists(toc_md_file)
268
+ GeneralUtilities.write_text_to_file(toc_md_file, self.__generate_toc_md_file_content(os.path.join(class_reference_folder,"toc.yml")))
269
+
270
+ @staticmethod
271
+ @GeneralUtilities.check_arguments
272
+ def __generate_toc_md_file_content(toc_file:str)->str:
273
+ """Generates the content of a markdown-table-of-content which contains a headline and links to the sub-files of the class-reference
274
+ based on the given toc.yml-file which was generated by docfx."""
275
+ toc_file_content = yaml.safe_load(GeneralUtilities.read_text_from_file(toc_file))
276
+ namespaces:list = list()
277
+ if isinstance(toc_file_content, dict):
278
+ namespaces = toc_file_content.get("items", list())
279
+ elif isinstance(toc_file_content, list):# older docfx-versions do not wrap the entries in an "items"-property
280
+ namespaces = toc_file_content
281
+ lines:list[str] = ["# Table of contents"]
282
+ for namespace in namespaces:
283
+ lines.append(GeneralUtilities.empty_string)
284
+ lines.append(f"## {TFCPS_CodeUnitSpecific_Base.__get_toc_entry_name(namespace)}")
285
+ lines.append(GeneralUtilities.empty_string)
286
+ entries:list = namespace.get("items", list())
287
+ if len(entries) == 0:
288
+ lines.append("(This namespace does not contain any documented type.)")
289
+ else:
290
+ for entry in entries:
291
+ lines.append(f"- [{TFCPS_CodeUnitSpecific_Base.__get_toc_entry_name(entry)}]({TFCPS_CodeUnitSpecific_Base.__get_toc_entry_link(entry)})")
292
+ return "\n".join(lines)+"\n"
293
+
294
+ @staticmethod
295
+ @GeneralUtilities.check_arguments
296
+ def __get_toc_entry_name(entry:dict)->str:
297
+ name:str = entry.get("name", entry.get("uid", GeneralUtilities.empty_string))
298
+ return name.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")# generic types like "List<T>" would be treated as html-tag otherwise
299
+
300
+ @staticmethod
301
+ @GeneralUtilities.check_arguments
302
+ def __get_toc_entry_link(entry:dict)->str:
303
+ uid:str = entry["uid"]
304
+ return "./"+uid.replace("`", "-")+".yml"# docfx replaces the backtick of generic types by a hyphen when generating the filenames
305
+
260
306
  @GeneralUtilities.check_arguments
261
307
  def use_cache(self)->bool:
262
308
  return self.__use_cache
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.3.25
3
+ Version: 4.3.26
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
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
9
9
  ScriptCollection/ProgramRunnerPopen.py,sha256=zVD-gZY85o8wiGFcpYAGNDl-tXaKzipl1Bkhqy2ois4,4681
10
10
  ScriptCollection/ProgramRunnerSudo.py,sha256=RXsiceQ8W6a8YDk_2BPscVbIAmDIpIxqe9WHBy2r4CM,5233
11
11
  ScriptCollection/SCLog.py,sha256=LdzSJy3NnnwYCCefz2h4tiTy4BjT8lOz3IBG_bMOg9E,4821
12
- ScriptCollection/ScriptCollectionCore.py,sha256=i1D4_NncFUcgbdOkR2B2zs_iPVAhE5MsB-snXmay1HI,246308
12
+ ScriptCollection/ScriptCollectionCore.py,sha256=Ljh_PPC5AmiWrFolh5LwiqYhkMJGYS8noIMaIaOuAbY,246308
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=WO2M28c2tUwsXFNa2L9zqMhdlyObWm3qpPE0LdIs7SE,2315
@@ -33,7 +33,7 @@ ScriptCollection/Resources/Fonts/DejaVuSans.ttf,sha256=faGVp0xVvvmI0NSPlQi9XYSUJ
33
33
  ScriptCollection/Resources/Fonts/LICENSE.txt,sha256=egg7E25k0GR5TDQZdR5cfdENL2TBCP5boWHq5eWVipM,8816
34
34
  ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz6xU2aGfr03tJRGczQrlpn-IeODc15d5kc0,232
35
35
  ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=rpuwSsQ6YQfZS2LGnvOH5ql8zs_-cHU4LQttS7XNT60,11272
36
- ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=oICRtl85n2puWvchcJIkmLZL1BAylMbzH7ltBGWfqgY,31973
36
+ ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=H9FWlS6BPK-UWJXdWN686ePky4Hq-Q13T0Kx8HSJu7s,34990
37
37
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=Ll5EOkpVpPiFrM2mLeQXolaF7075IwgtnHXvfdpkH4k,9904
38
38
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=uY1A8UeZZFFQ-Fdtf_V1zIWkvXCsePEpMtzZjamLmK4,31077
39
39
  ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=X2NgZgbOkJsdZ6wMHB_RuS_rQCuz5oQCqzYrxyXBN9Q,6680
@@ -49,7 +49,7 @@ ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
49
49
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
50
50
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
51
51
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
52
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=UInAjTB5W9nXBccHBaPGTkjWBy8saMfQ7bfiYlgBtYc,43893
52
+ ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=ncSqBaJzmk8ZdVi3hnYJGNNQqPPomufwBfGUEPyifs8,43954
53
53
  ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=d8U-sIhsneMplYkG73BJRQQZh4uLoX7QiOhbnZNuOM8,8540
55
55
  ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -63,8 +63,8 @@ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=Bd1gxCk9Fb
63
63
  ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
65
65
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
- scriptcollection-4.3.25.dist-info/METADATA,sha256=lAXTpAwrNwVxrcYWA-9f8lCpUdKoBBUh_V2QTPGHZHY,7816
67
- scriptcollection-4.3.25.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
68
- scriptcollection-4.3.25.dist-info/entry_points.txt,sha256=Iq9YMSTWNCAJpBzM5L9CQx80tL9-XUu6MzDRAdBrIPg,5875
69
- scriptcollection-4.3.25.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
70
- scriptcollection-4.3.25.dist-info/RECORD,,
66
+ scriptcollection-4.3.26.dist-info/METADATA,sha256=aBbUEp_5x-4nl9nXzLQy9V4bHIIDkQrDCwZi2-1vBuw,7816
67
+ scriptcollection-4.3.26.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
68
+ scriptcollection-4.3.26.dist-info/entry_points.txt,sha256=Iq9YMSTWNCAJpBzM5L9CQx80tL9-XUu6MzDRAdBrIPg,5875
69
+ scriptcollection-4.3.26.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
70
+ scriptcollection-4.3.26.dist-info/RECORD,,