Skip to content

Commit

Permalink
Merge branch 'issue45' into 'master'
Browse files Browse the repository at this point in the history
Fix parameter markup

Closes python#45

See merge request python-devs/importlib_resources!46
  • Loading branch information
warsaw committed Dec 12, 2017
2 parents 021a488 + 23e209c commit 041b1f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions importlib_resources/docs/abc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ resources.
see if it supports the ``ResourceReader`` interface. If it does, it will use
that for all resource access.


ResourceReader API
==================

The ``ResourceReader`` ABC decorates its methods with ``@abstractmethod`` to
indicate that they must all be overridden by the loader that implements this
interface. However, the default implementation of each of these methods is to
Expand All @@ -38,7 +34,7 @@ This is so that if the ABC method is accidentally called,

.. py:method:: open_resource(resource)
Open the named **resource** for binary reading. The argument must be
Open the named *resource* for binary reading. The argument must be
filename-like, i.e. it cannot have any path separators in the string.
If the resource cannot be found, :py:exc:`FileNotFoundError` should be
raised.
Expand All @@ -53,7 +49,7 @@ This is so that if the ABC method is accidentally called,

.. py:method:: resource_path(resource)
Return the path to the named **resource** as found on the file
Return the path to the named *resource* as found on the file
system.

If the resource is not natively accessible on the file system
Expand All @@ -73,13 +69,13 @@ This is so that if the ABC method is accidentally called,

.. py:method:: is_resource(name)
Return a boolean indicating whether **name** is a resource within the
Return a boolean indicating whether *name* is a resource within the
package. *Remember that directories are not resources!*

:param name: A filename-like string (i.e. no path separators) to check
whether it is a resource within the package.
:type resource: str
:return: Flag indicating whether **name** is a resource or not.
:return: Flag indicating whether *name* is a resource or not.
:rtype: bool
:raises FileNotFoundError: when the named resource is not found within
the package.
Expand Down
4 changes: 2 additions & 2 deletions importlib_resources/docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ Functions

.. py:function:: importlib_resources.read_text(package, resource, encoding='utf-8', errors='strict')
Read and return the contents of *resource* within *package* as a ``str [#fn1]_.
By default, the contents are read as strict UTF-8.
Read and return the contents of *resource* within *package* as a ``str``
[#fn1]_. By default, the contents are read as strict UTF-8.

:param package: A package name or module object. See above for the API
that such module objects must support.
Expand Down

0 comments on commit 041b1f7

Please sign in to comment.