Lines Matching full:resource

19     'Resource',
31 Resource = Union[str, os.PathLike] variable
85 def open_binary(package: Package, resource: Resource) -> BinaryIO: argument
86 """Return a file-like object opened for binary reading of the resource."""
87 resource = _normalize_path(resource)
91 return reader.open_resource(resource)
95 full_path = os.path.join(package_path, resource)
99 # Just assume the loader is a resource loader; all the relevant
109 message = '{!r} resource not found in {!r}'.format(
110 resource, package_name)
117 resource: Resource, argument
120 """Return a file-like object opened for text reading of the resource."""
121 resource = _normalize_path(resource)
125 return TextIOWrapper(reader.open_resource(resource), encoding, errors)
129 full_path = os.path.join(package_path, resource)
133 # Just assume the loader is a resource loader; all the relevant
143 message = '{!r} resource not found in {!r}'.format(
144 resource, package_name)
150 def read_binary(package: Package, resource: Resource) -> bytes: argument
151 """Return the binary contents of the resource."""
152 resource = _normalize_path(resource)
154 with open_binary(package, resource) as fp:
159 resource: Resource, argument
162 """Return the decoded string of the resource.
167 resource = _normalize_path(resource)
169 with open_text(package, resource, encoding, errors) as fp:
174 def path(package: Package, resource: Resource) -> Iterator[Path]: argument
175 """A context manager providing a file path object to the resource.
177 If the resource does not already exist on its own on the file system,
183 resource = _normalize_path(resource)
188 yield Path(reader.resource_path(resource))
197 file_path = package_directory / resource
201 with open_binary(package, resource) as fp:
219 """True if 'name' is a resource inside 'package'.
235 # contents doesn't necessarily mean it's a resource. Directories are not
246 to check if it is a resource or not.
279 def open_resource(self, resource): argument
281 path = f'{fullname_as_path}/{resource}'
287 def resource_path(self, resource): argument
295 # resource. Otherwise it isn't.
325 # namespace), relative to the package given when the resource