MCPcopy
hub / github.com/pypa/pipx / write

Method write

src/pipx/pipx_metadata_file.py:215–237  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

213 raise PipxError("Internal Error: PipxMetadata is corrupt, cannot write.")
214
215 def write(self) -> None:
216 self._validate_before_write()
217 try:
218 with open(self.venv_dir / PIPX_INFO_FILENAME, "w", encoding="utf-8") as pipx_metadata_fh:
219 json.dump(
220 self.to_dict(),
221 pipx_metadata_fh,
222 indent=4,
223 sort_keys=True,
224 cls=JsonEncoderHandlesPath,
225 )
226 except OSError:
227 _LOGGER.warning(
228 pipx_wrap(
229 f"""
230 {hazard} Unable to write {PIPX_INFO_FILENAME} to
231 {self.venv_dir}. This may cause future pipx operations
232 involving {self.venv_dir.name} to fail or behave
233 incorrectly.
234 """,
235 subsequent_indent=" " * 4,
236 )
237 )
238
239 def read(self, verbose: bool = False) -> None:
240 try:

Callers 15

failFunction · 0.80
animateFunction · 0.80
print_animationFunction · 0.80
hide_cursorFunction · 0.80
show_cursorFunction · 0.80
clear_lineFunction · 0.80
_downloadFunction · 0.80
uninstall_packageMethod · 0.80

Calls 3

to_dictMethod · 0.95
pipx_wrapFunction · 0.85