Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagram Cache issue in Python under Windows #483

Open
ChristopherFoerster opened this issue Dec 10, 2024 · 1 comment
Open

Diagram Cache issue in Python under Windows #483

ChristopherFoerster opened this issue Dec 10, 2024 · 1 comment

Comments

@ChristopherFoerster
Copy link

We are facing an issue that in some model the diagram cache contains several svgs with case sensitive duplicates. Means under windows this fails to use:(as same files will be overwritten )
image

Is there a flag or approach to avoid/fix this?

Under Unix/Docker the scripting works. Developing the exports with capellambse diagram cache under Windows brings us issues.

The svg diagrams are really not the same and partly even in different layers. Partly 3 duplicates in one model.

@Wuestengecko
Copy link
Member

Oh, Windows and file names :)

There's no easy way to prevent that, as those are the exact IDs used to distinguish between the diagrams internally. However, if you want to only use the diagram cache on Windows, you can work around the issue by packing all the exported diagrams into a *.zip file (while still inside the Docker container) and directly using that archive:

import pathlib, capellambse

zip_path = pathlib.Path("C:/somewhere/diagrams.zip")
zip_uri = "zip+" + zip_path.resolve().as_uri()

model = capellambse.MelodyModel(..., diagram_cache = zip_uri)

The exporter script on the other hand currently only supports writing to local directories. It would first need to be migrated to use the FileHandler abstractions (which is a manageable amount of effort - all of the related code should be in capellambse/_diagram_cache.py), and we also need to implement write support in the ZipFileHandler (which should be relatively easy, as it basically just needs to forward the calls to the stdlib zipfile module).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants