Lines Matching refs:package
44 def open_binary(package: Package, resource: Resource) -> BinaryIO:
46 return (_common.files(package) / normalize_path(resource)).open('rb')
50 def read_binary(package: Package, resource: Resource) -> bytes:
52 return (_common.files(package) / normalize_path(resource)).read_bytes()
57 package: Package,
63 return (_common.files(package) / normalize_path(resource)).open(
70 package: Package,
80 with open_text(package, resource, encoding, errors) as fp:
85 def contents(package: Package) -> Iterable[str]:
86 """Return an iterable of entries in `package`.
92 return [path.name for path in _common.files(package).iterdir()]
96 def is_resource(package: Package, name: str) -> bool:
97 """True if `name` is a resource inside `package`.
104 for traversable in _common.files(package).iterdir()
110 package: Package,
121 return _common.as_file(_common.files(package) / normalize_path(resource))