It looks like you're new here. If you want to get involved, click one of these buttons!
Hello Matthias,
Soo Long time not on this forum.
We are making now in my team a large usage of the package management and technology management tools and this is really convenient and powerful (with the exception of not being able to use it on a github with login/password required, but that's not a big issue)
However in our packages we need few more directory that the one created in the templates available. We wan't these directory to be created "automatically" when we create a new package. I digged in the klayout directory (windows, compiled) to find files describing these templates, but no luck.
Is it possible to create our own package's template?
What is the format used and how is it coded ? Is there a sample file available? or can this be done through scripting?
If it's possible to create these templates, where should the file be stored?
Regards
Joël
Comments
Hi Joël,
I'm afraid I don't fully understand. What's a package template?
Basically you don't need to use a template. If you check the available packages there are all kind of structures, some with quite nested folders.
If you create packages you can copy them from a template of yours. A package is essentially only a folder structure that is downloaded from some repository.
Matthias
Hi Matthias
Thanks for your answer
i mean the list of possible packages type available when you click on create packages.
from my understanding they are only built-in (https://github.com/KLayout/klayout/tree/master/src/lay/lay/salt_templates), and i ask if it is possible to add "externally" other "type" of packages in the list (basically with another directory structure than the available one).
I don't know if i am clear enough
Joël
I even forgot there are templates ...
Actually, the system is very simple. You don't need to start from a template. You can pick an empty folder and populate it with any kind of files. The folder structure is identical to the folders in "~/.klayout":
"tech" can host technology definitions (.lyt files) with tech-specific "macros", etc.
You need to supply these folders only if you plan to deploy certain things - for example "pymacros" and (most likely) "python" if you want to supply Python scripts. Installing the package will simply copy these folders to a certain place, and once KLayout starts it will scan these folders for interesting files - specifically auto-run .lym files. That's when your script package can become alive.
To identify the package, KLayout needs a descriptor file called "grain.xml" on the top level of your package. That's a simple XML file with a little bit of information describing the package (name, author, documentation URL, version etc.).
Deployment is by deploying this structure through one of the supported Git providers and registering the package. Registration will simply add your package to the global package index and points KLayout to the place from where to download the files.
Some documentation is here: https://www.klayout.de/doc-qt5/about/packages.html and https://www.klayout.de/package_cookbook.html
Matthias
Hi Matthias
Yes that's what currently do, copy a "Template" directory with all what we need in the local place (~/klayout/salt) and edit relevant things (eg. grain.xml)
Actually the simplicity of use when you click on the create package button and select a template is what i have in mind with this specific salt "template", instead of having to copy a folder, edit the grain.xml and so on..
but i admit that is more a "comfort thing" than anything else
Joël