logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

_meta.py (1130B)


  1. from typing import Any, Dict, Iterator, List, Protocol, TypeVar, Union
  2. _T = TypeVar("_T")
  3. class PackageMetadata(Protocol):
  4. def __len__(self) -> int:
  5. ... # pragma: no cover
  6. def __contains__(self, item: str) -> bool:
  7. ... # pragma: no cover
  8. def __getitem__(self, key: str) -> str:
  9. ... # pragma: no cover
  10. def __iter__(self) -> Iterator[str]:
  11. ... # pragma: no cover
  12. def get_all(self, name: str, failobj: _T = ...) -> Union[List[Any], _T]:
  13. """
  14. Return all values associated with a possibly multi-valued key.
  15. """
  16. @property
  17. def json(self) -> Dict[str, Union[str, List[str]]]:
  18. """
  19. A JSON-compatible form of the metadata.
  20. """
  21. class SimplePath(Protocol):
  22. """
  23. A minimal subset of pathlib.Path required by PathDistribution.
  24. """
  25. def joinpath(self) -> 'SimplePath':
  26. ... # pragma: no cover
  27. def __div__(self) -> 'SimplePath':
  28. ... # pragma: no cover
  29. def parent(self) -> 'SimplePath':
  30. ... # pragma: no cover
  31. def read_text(self) -> str:
  32. ... # pragma: no cover