ScriptCollection 4.2.141__py3-none-any.whl → 4.2.142__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.2.141"
41
+ version = "4.2.142"
42
42
  __version__ = version
43
43
 
44
44
  class VSCodeWorkspaceShellTask:
@@ -29,6 +29,11 @@ class TFCPS_Tools_General:
29
29
  # Relative path (inside the source-repository and inside the ScriptCollection.Resources-package) of the
30
30
  # file that pins the OpenAPIGenerator-version used as default when no repository-specific version is given.
31
31
  __openapigenerator_version_resource_relative_path:str="Dependencies/OpenAPIGenerator/Version.txt"
32
+ # Font used for rendering all PlantUML-diagrams. Pinning it makes the resulting SVG identical across machines
33
+ # (PlantUML's default 'sans-serif' otherwise resolves to different host-fonts on Windows vs Linux, which changes
34
+ # the computed text-lengths and coordinates and thus produces spurious diffs). The font is available in the
35
+ # build-image via the apt-package 'fonts-dejavu'.
36
+ __default_diagram_font_name:str="DejaVu Sans"
32
37
 
33
38
  def __init__(self,sc:ScriptCollectionCore):
34
39
  self.__sc=sc
@@ -640,15 +645,23 @@ class TFCPS_Tools_General:
640
645
 
641
646
  @GeneralUtilities.check_arguments
642
647
  def __generate_svg_files_from_plantuml(self, diagrams_files_folder: str, plantuml_jar_file: str) -> None:
643
- for file in GeneralUtilities.get_all_files_of_folder(diagrams_files_folder):
644
- if file.endswith(".plantuml"):
645
- output_filename = self.get_output_filename_for_plantuml_filename(file)
646
- argument = ['-jar',plantuml_jar_file, '-tsvg', os.path.basename(file)]
647
- folder = os.path.dirname(file)
648
- self.__sc.run_program_argsasarray("java", argument, folder)
649
- result_file = folder+"/" + output_filename
650
- GeneralUtilities.assert_file_exists(result_file)
651
- self.__sc.format_xml_file(result_file)
648
+ # Pin the font for all rendered diagrams via a PlantUML-config-file so the resulting SVG is identical across
649
+ # machines, without having to add a skinparam to every (also hand-written) .plantuml-file. See the comment at
650
+ # __default_diagram_font_name for the reason.
651
+ font_config_file = os.path.join(tempfile.gettempdir(), f"plantuml-font-config-{uuid.uuid4()}.cfg")
652
+ GeneralUtilities.write_text_to_file(font_config_file, f'skinparam defaultFontName "{TFCPS_Tools_General.__default_diagram_font_name}"')
653
+ try:
654
+ for file in GeneralUtilities.get_all_files_of_folder(diagrams_files_folder):
655
+ if file.endswith(".plantuml"):
656
+ output_filename = self.get_output_filename_for_plantuml_filename(file)
657
+ argument = ['-jar',plantuml_jar_file, '-tsvg', '-config', font_config_file, os.path.basename(file)]
658
+ folder = os.path.dirname(file)
659
+ self.__sc.run_program_argsasarray("java", argument, folder)
660
+ result_file = folder+"/" + output_filename
661
+ GeneralUtilities.assert_file_exists(result_file)
662
+ self.__sc.format_xml_file(result_file)
663
+ finally:
664
+ GeneralUtilities.ensure_file_does_not_exist(font_config_file)
652
665
 
653
666
  @GeneralUtilities.check_arguments
654
667
  def get_output_filename_for_plantuml_filename(self, plantuml_file: str) -> str:
@@ -670,7 +683,7 @@ class TFCPS_Tools_General:
670
683
  lines = ["@startuml CodeUnits-Overview"]
671
684
  # Pin font so the rendered SVG is byte-identical across machines (Java/PlantUML's
672
685
  # default 'sans-serif' otherwise resolves to different host fonts on Windows vs Linux).
673
- lines.append('skinparam defaultFontName "DejaVu Sans"')
686
+ lines.append(f'skinparam defaultFontName "{TFCPS_Tools_General.__default_diagram_font_name}"')
674
687
  lines.append(f"title CodeUnits of {project_name}")
675
688
 
676
689
  codeunits = self.get_codeunits(repository_folder)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.2.141
3
+ Version: 4.2.142
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=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=tWTdHA0yC4lSBMgCstxJYuwiYt1tl1-COYUa5dxNLpk,217136
12
+ ScriptCollection/ScriptCollectionCore.py,sha256=SAGh9zm10KLbSSLC2XxAw-WmI-Wb-FvjPAD2pyFS7y8,217136
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
@@ -34,7 +34,7 @@ ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=5vCFfDiU8bvfcnoKNs2ATS8nsl6mYXcIu
34
34
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=BsSV4a-NZY86MZ20d-_rYxNVAI4UzAfmEwXlRZ8qWQc,7685
35
35
  ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=QRm8n1qH8H_XbJhGCbzwdNr9KSEy0WkbG7ulpc4Md3U,22696
36
36
  ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=JYiDqDsfVJQWS9xWMi_UzfXnXsJRnPRxAzFr82bUEvI,2370
37
- ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=srsEawFeFHsGyEDQElDvHH9fV6tlEPVdXJcTZv0L2a8,114073
37
+ ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=Ui_jZpTL9CW0DSkpokLI0MUkdH4dTUH2ymDCc8pRSxc,115268
38
38
  ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=wS2yzYUmJ4m0cf6cBYVTHsiXSXfYhHoLFFy8x6yEQvY,19573
40
40
  ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -55,8 +55,8 @@ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=fqGhXNx8tK
55
55
  ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
57
57
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- scriptcollection-4.2.141.dist-info/METADATA,sha256=nL4RtugOkry8oj2ijNnxB9BZ-pf4ALb014AdQdcyWHk,7817
59
- scriptcollection-4.2.141.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
60
- scriptcollection-4.2.141.dist-info/entry_points.txt,sha256=kUHH9H7MmheMRWvygzYBAw76GwbBKKsSWLyWI-nnNKw,5292
61
- scriptcollection-4.2.141.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
62
- scriptcollection-4.2.141.dist-info/RECORD,,
58
+ scriptcollection-4.2.142.dist-info/METADATA,sha256=2YPSeP8iem-PnABUVkTueuiNkxwzluO1-ncqfvbdpDs,7817
59
+ scriptcollection-4.2.142.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
60
+ scriptcollection-4.2.142.dist-info/entry_points.txt,sha256=kUHH9H7MmheMRWvygzYBAw76GwbBKKsSWLyWI-nnNKw,5292
61
+ scriptcollection-4.2.142.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
62
+ scriptcollection-4.2.142.dist-info/RECORD,,