|
49 | 49 | .. method:: open_resource(resource) |
50 | 50 | :abstractmethod: |
51 | 51 |
|
52 | | - Returns an opened, :term:`file-like object` for binary reading |
53 | | - of the *resource*. |
| 52 | + Returns an opened, :term:`file-like object` for binary reading |
| 53 | + of the *resource*. |
54 | 54 |
|
55 | | - If the resource cannot be found, :exc:`FileNotFoundError` is |
56 | | - raised. |
| 55 | + If the resource cannot be found, :exc:`FileNotFoundError` is |
| 56 | + raised. |
57 | 57 |
|
58 | 58 | .. method:: resource_path(resource) |
59 | 59 | :abstractmethod: |
60 | 60 |
|
61 | | - Returns the file system path to the *resource*. |
| 61 | + Returns the file system path to the *resource*. |
62 | 62 |
|
63 | | - If the resource does not concretely exist on the file system, |
64 | | - raise :exc:`FileNotFoundError`. |
| 63 | + If the resource does not concretely exist on the file system, |
| 64 | + raise :exc:`FileNotFoundError`. |
65 | 65 |
|
66 | 66 | .. method:: is_resource(name) |
67 | 67 | :abstractmethod: |
68 | 68 |
|
69 | | - Returns ``True`` if the named *name* is considered a resource. |
70 | | - :exc:`FileNotFoundError` is raised if *name* does not exist. |
| 69 | + Returns ``True`` if the named *name* is considered a resource. |
| 70 | + :exc:`FileNotFoundError` is raised if *name* does not exist. |
71 | 71 |
|
72 | 72 | .. method:: contents() |
73 | 73 | :abstractmethod: |
74 | 74 |
|
75 | | - Returns an :term:`iterable` of strings over the contents of |
76 | | - the package. Do note that it is not required that all names |
77 | | - returned by the iterator be actual resources, e.g. it is |
78 | | - acceptable to return names for which :meth:`is_resource` would |
79 | | - be false. |
80 | | - |
81 | | - Allowing non-resource names to be returned is to allow for |
82 | | - situations where how a package and its resources are stored |
83 | | - are known a priori and the non-resource names would be useful. |
84 | | - For instance, returning subdirectory names is allowed so that |
85 | | - when it is known that the package and resources are stored on |
86 | | - the file system then those subdirectory names can be used |
87 | | - directly. |
88 | | - |
89 | | - The abstract method returns an iterable of no items. |
| 75 | + Returns an :term:`iterable` of strings over the contents of |
| 76 | + the package. Do note that it is not required that all names |
| 77 | + returned by the iterator be actual resources, e.g. it is |
| 78 | + acceptable to return names for which :meth:`is_resource` would |
| 79 | + be false. |
| 80 | + |
| 81 | + Allowing non-resource names to be returned is to allow for |
| 82 | + situations where how a package and its resources are stored |
| 83 | + are known a priori and the non-resource names would be useful. |
| 84 | + For instance, returning subdirectory names is allowed so that |
| 85 | + when it is known that the package and resources are stored on |
| 86 | + the file system then those subdirectory names can be used |
| 87 | + directly. |
| 88 | + |
| 89 | + The abstract method returns an iterable of no items. |
90 | 90 |
|
91 | 91 |
|
92 | 92 | .. class:: Traversable |
|
0 commit comments