MCPcopy
hub / github.com/pex-tool/pex / load

Method load

pex/http/server.py:47–64  ·  view source on GitHub ↗
(
        cls,
        server_name,  # type: str
        cache_dir,  # type: str
    )

Source from the content-addressed store, hash-verified

45
46 @classmethod
47 def load(
48 cls,
49 server_name, # type: str
50 cache_dir, # type: str
51 ):
52 # type: (...) -> Optional[Pidfile]
53 pidfile = cls._pidfile(cache_dir)
54 try:
55 with open(pidfile) as fp:
56 data = json.load(fp)
57 return cls(ServerInfo(url=data["url"], pid=data["pid"]))
58 except (OSError, IOError, ValueError, KeyError) as e:
59 logger.debug(
60 "Failed to load {server} pid file from {path}: {err}".format(
61 server=server_name, path=pidfile, err=e
62 )
63 )
64 return None
65
66 @staticmethod
67 def _read_url(

Callers 5

find_pex_dirFunction · 0.45
pidfileMethod · 0.45
resolve_run_specMethod · 0.45
_resolve_pylockMethod · 0.45
syncMethod · 0.45

Calls 2

ServerInfoClass · 0.85
_pidfileMethod · 0.80

Tested by

no test coverage detected