MCPcopy Index your code
hub / github.com/python/mypy / cmd_status

Method cmd_status

mypy/dmypy_server.py:294–304  ·  view source on GitHub ↗

Return daemon status.

(self, fswatcher_dump_file: str | None = None)

Source from the content-addressed store, hash-verified

292 # Command functions (run in the server via RPC).
293
294 def cmd_status(self, fswatcher_dump_file: str | None = None) -> dict[str, object]:
295 """Return daemon status."""
296 res: dict[str, object] = {}
297 res.update(get_meminfo())
298 if fswatcher_dump_file:
299 data = self.fswatcher.dump_file_data() if hasattr(self, "fswatcher") else {}
300 # Using .dumps and then writing was noticeably faster than using dump
301 s = json.dumps(data)
302 with open(fswatcher_dump_file, "w") as f:
303 f.write(s)
304 return res
305
306 def cmd_stop(self) -> dict[str, object]:
307 """Stop daemon."""

Callers

nothing calls this directly

Calls 6

get_meminfoFunction · 0.85
hasattrFunction · 0.85
dump_file_dataMethod · 0.80
dumpsMethod · 0.80
updateMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected