Skip to content
Snippets Groups Projects
Commit eb0d21ed authored by David Lanzendörfer's avatar David Lanzendörfer
Browse files

Add helper function

List available processes
parent 820c1647
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,20 @@ import pint
import librepdk.technologies
def available_technologies():
techfile_filter = os.path.join("librepdk","technologies","*.tech.*")
# find technology files
techfiles=[]
for path in sys.path:
techfiles += glob(os.path.join(path,techfile_filter))
# extract names
technologies = []
for i, file in enumerate(techfiles):
module = SourceFileLoader(str(i), file).load_module()
if hasattr(module, "name"):
technologies.append(module.name)
return technologies
class Config:
confname = None
tech_data = None
......@@ -24,8 +38,8 @@ class Config:
techfiles=[]
electricfiles=[]
for path in sys.path:
techfiles+=glob(os.path.join(path,techfile_filter))
electricfiles+=glob(os.path.join(path,electric_filter))
techfiles += glob(os.path.join(path,techfile_filter))
electricfiles += glob(os.path.join(path,electric_filter))
# find technology files
technologies = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment