MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _find_slicap_preamble

Function _find_slicap_preamble

SLiCAP/schematic/parameter_dialog.py:19–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def _find_slicap_preamble() -> str:
20 try:
21 import importlib
22 sl = importlib.import_module("SLiCAP")
23 install_path = getattr(getattr(sl, "ini", None), "install_path", None)
24 if install_path:
25 c = Path(install_path) / "tex" / "preambuleSLiCAP.tex"
26 if c.exists():
27 return str(c)
28 except Exception:
29 pass
30 ini = Path.home() / "SLiCAP.ini"
31 if ini.exists():
32 try:
33 cfg = configparser.ConfigParser()
34 cfg.read(str(ini))
35 install_path = cfg.get("install", "installpath", fallback="")
36 if install_path:
37 c = Path(install_path) / "tex" / "preambuleSLiCAP.tex"
38 if c.exists():
39 return str(c)
40 except Exception:
41 pass
42 return ""
43
44
45class ParameterDialog(QDialog):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected