Lines Matching full:resource
12 Resource = str variable
44 def open_binary(package: Package, resource: Resource) -> BinaryIO: argument
45 """Return a file-like object opened for binary reading of the resource."""
46 return (_common.files(package) / normalize_path(resource)).open('rb')
50 def read_binary(package: Package, resource: Resource) -> bytes: argument
51 """Return the binary contents of the resource."""
52 return (_common.files(package) / normalize_path(resource)).read_bytes()
58 resource: Resource, argument
62 """Return a file-like object opened for text reading of the resource."""
63 return (_common.files(package) / normalize_path(resource)).open(
71 resource: Resource, argument
75 """Return the decoded string of the resource.
80 with open_text(package, resource, encoding, errors) as fp:
90 to check if it is a resource or not.
97 """True if `name` is a resource inside `package`.
101 resource = normalize_path(name)
103 traversable.name == resource and traversable.is_file()
111 resource: Resource, argument
113 """A context manager providing a file path object to the resource.
115 If the resource does not already exist on its own on the file system,
121 return _common.as_file(_common.files(package) / normalize_path(resource))