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

Method record

testing/devpi.py:82–100  ·  view source on GitHub ↗
(
        cls,
        log,  # type: str
        pid,  # type: int
        timeout=5.0,  # type: float
    )

Source from the content-addressed store, hash-verified

80
81 @classmethod
82 def record(
83 cls,
84 log, # type: str
85 pid, # type: int
86 timeout=5.0, # type: float
87 ):
88 # type: (...) -> Optional[Pidfile]
89 base_url = cls._read_base_url(log, timeout)
90 if not base_url:
91 return None
92
93 create_time = cls._get_process_creation_time(pid)
94 if create_time is None:
95 return None
96
97 url = "{base_url}/root/pypi/+simple/".format(base_url=base_url)
98 with safe_open(cls._PATH, "w") as fp:
99 json.dump(dict(url=url, pid=pid, create_time=create_time), fp, indent=2, sort_keys=True)
100 return cls(url=url, pid=pid, create_time=create_time)
101
102 url = attr.ib() # type: str
103 pid = attr.ib() # type: int

Callers 1

launchFunction · 0.45

Calls 4

safe_openFunction · 0.90
_read_base_urlMethod · 0.80
dumpMethod · 0.45

Tested by

no test coverage detected