It looks like you're new here. If you want to get involved, click one of these buttons!
Hello guys,
Does anyone have any idea how to get the version number of the package of an associated active technology?
I tried something like this:
import pya
window = pya.Application.instance().main_window()
tech = pya.Technology.technology_by_name(window.initial_technology)
I could not find any reference to the version number of the package inside the tech object. Am I searching at a wrong place or is it impossible at the moment and I need to find another way?
Comments
I'm sorry, but there is no API for packages available in Python.
You can basically scan the package files which are plain XML files.
Look for files inside all folders listed in
pya.Application.instance().klayout_path()
and there in the "salt" subfolder. Look for files called "grain.xml" recursively.Technology packages are ones where there is a "tech" folder in the same directory than the "grain.xml" file. Inside that "grain.xml" you will find the version number in the "version" element.
Matthias