MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _LuatexKpsewhich

Class _LuatexKpsewhich

lib/matplotlib/dviread.py:1251–1273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1249
1250
1251class _LuatexKpsewhich:
1252 @cache # A singleton.
1253 def __new__(cls):
1254 self = object.__new__(cls)
1255 self._proc = self._new_proc()
1256 return self
1257
1258 def _new_proc(self):
1259 return subprocess.Popen(
1260 ["luatex", "--luaonly", str(cbook._get_data_path("kpsewhich.lua"))],
1261 # mktexpk logs to stderr; suppress that.
1262 stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
1263 # Store generated pk fonts in our own cache.
1264 env={"MT_VARTEXFONTS": str(Path(mpl.get_cachedir(), "vartexfonts")),
1265 **os.environ})
1266
1267 def search(self, filename):
1268 if self._proc.poll() is not None: # Dead, restart it.
1269 self._proc = self._new_proc()
1270 self._proc.stdin.write(os.fsencode(filename) + b"\n")
1271 self._proc.stdin.flush()
1272 out = self._proc.stdout.readline().rstrip()
1273 return None if out == b"nil" else os.fsdecode(out)
1274
1275
1276@lru_cache

Callers 1

find_tex_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…