From 83bf56db507a8a88eb80dce353067c608134a76a Mon Sep 17 00:00:00 2001 From: Marat Sharafutdinov Date: Tue, 3 Sep 2019 16:09:00 +0300 Subject: [PATCH] Fix documentation --- README.rst | 6 +++--- aio_pika/connection.py | 12 +++--------- aio_pika/exchange.py | 6 +++--- aio_pika/message.py | 14 +++++++------- aio_pika/queue.py | 6 +++--- aio_pika/robust_connection.py | 12 +++--------- aio_pika/tools.py | 2 +- docs/source/conf.py | 2 +- docs/source/index.rst | 10 +++++----- docs/source/patterns.rst | 4 ++-- docs/source/rabbitmq-tutorial/1-introduction.rst | 2 +- 11 files changed, 32 insertions(+), 44 deletions(-) diff --git a/README.rst b/README.rst index cbd95237..14a7eee1 100644 --- a/README.rst +++ b/README.rst @@ -222,13 +222,13 @@ Clone the project: git clone https://github.com/mosquito/aio-pika.git cd aio-pika -Create a new virtualenv for `aio_pika`_: +Create a new virtualenv for `aio-pika`_: .. code-block:: shell virtualenv -p python3.5 env -Install all requirements for `aio_pika`_: +Install all requirements for `aio-pika`_: .. code-block:: shell @@ -269,4 +269,4 @@ The changes should follow simple rules: .. _"thank's to" section: https://github.com/mosquito/aio-pika/blob/master/docs/source/index.rst#thanks-for-contributing .. _Semantic Versioning: http://semver.org/ -.. _aio_pika: https://github.com/mosquito/aio-pika/ +.. _aio-pika: https://github.com/mosquito/aio-pika/ diff --git a/aio_pika/connection.py b/aio_pika/connection.py index 3d6981c3..03f7ce3d 100644 --- a/aio_pika/connection.py +++ b/aio_pika/connection.py @@ -257,24 +257,18 @@ async def main(): will be used keyword arguments. :param host: hostname of the broker :param port: broker port 5672 by default - :param login: - username string. `'guest'` by default. Provide empty string - for pika.credentials.ExternalCredentials usage. + :param login: username string. `'guest'` by default. :param password: password string. `'guest'` by default. :param virtualhost: virtualhost parameter. `'/'` by default - :param ssl: - use SSL for connection. Should be used with addition kwargs. - See `pika documentation`_ for more info. + :param ssl: use SSL for connection. Should be used with addition kwargs. :param ssl_options: A dict of values for the SSL connection. :param loop: Event loop (:func:`asyncio.get_event_loop()` when :class:`None`) :param connection_class: Factory of a new connection - :param kwargs: - addition parameters which will be passed to the pika connection. + :param kwargs: addition parameters which will be passed to the connection. :return: :class:`aio_pika.connection.Connection` .. _RFC3986: https://goo.gl/MzgYAs - .. _pika documentation: https://goo.gl/TdVuZ9 .. _official Python documentation: https://goo.gl/pty9xA diff --git a/aio_pika/exchange.py b/aio_pika/exchange.py index d6665bd5..8cc3f829 100644 --- a/aio_pika/exchange.py +++ b/aio_pika/exchange.py @@ -117,7 +117,7 @@ async def bind( :param exchange: :class:`aio_pika.exchange.Exchange` instance :param routing_key: routing key - :param arguments: additional arguments (will be passed to `pika`) + :param arguments: additional arguments :param timeout: execution timeout :return: :class:`None` """ @@ -146,7 +146,7 @@ async def unbind( :param exchange: :class:`aio_pika.exchange.Exchange` instance :param routing_key: routing key - :param arguments: additional arguments (will be passed to `pika`) + :param arguments: additional arguments :param timeout: execution timeout :return: :class:`None` """ @@ -171,7 +171,7 @@ async def publish( immediate: bool = False, timeout: TimeoutType = None ) -> Optional[aiormq.types.ConfirmationFrameType]: - """ Publish the message to the queue. `aio_pika` use + """ Publish the message to the queue. `aio-pika` uses `publisher confirms`_ extension for message delivery. .. _publisher confirms: https://www.rabbitmq.com/confirms.html diff --git a/aio_pika/message.py b/aio_pika/message.py index cfef844f..04a3f4d0 100644 --- a/aio_pika/message.py +++ b/aio_pika/message.py @@ -352,7 +352,7 @@ def locked(self) -> bool: @property def properties(self) -> aiormq.spec.Basic.Properties: - """ Build :class:`pika.BasicProperties` object """ + """ Build :class:`aiormq.spec.Basic.Properties` object """ return aiormq.spec.Basic.Properties( content_type=self.content_type, content_encoding=self.content_encoding, @@ -410,7 +410,7 @@ def __copy__(self): class IncomingMessage(Message): - """ Incoming message it's seems like Message but has additional methods for + """ Incoming message is seems like Message but has additional methods for message acknowledgement. Depending on the acknowledgement mode used, RabbitMQ can consider a @@ -528,9 +528,9 @@ def ack(self, multiple: bool = False) -> asyncio.Task: """ Send basic.ack is used for positive acknowledgements .. note:: - This method looks like a blocking-method, but actually it's - just send bytes to the socket and not required any responses - from the broker. + This method looks like a blocking-method, but actually it just + sends bytes to the socket and doesn't require any responses from + the broker. :param multiple: If set to True, the message's delivery tag is treated as "up to and including", so that multiple @@ -561,8 +561,8 @@ def reject(self, requeue: bool = False) -> asyncio.Task: Otherwise message will be dropped. .. note:: - This method looks like a blocking-method, but actually it's just - send bytes to the socket and not required any responses from + This method looks like a blocking-method, but actually it just + sends bytes to the socket and doesn't require any responses from the broker. :param requeue: bool diff --git a/aio_pika/queue.py b/aio_pika/queue.py index df1eb045..c84ecfb2 100644 --- a/aio_pika/queue.py +++ b/aio_pika/queue.py @@ -105,7 +105,7 @@ async def bind( :param exchange: :class:`aio_pika.exchange.Exchange` instance :param routing_key: routing key - :param arguments: additional arguments (will be passed to `pika`) + :param arguments: additional arguments :param timeout: execution timeout :raises asyncio.TimeoutError: when the binding timeout period has elapsed. @@ -138,7 +138,7 @@ async def unbind( :param exchange: :class:`aio_pika.exchange.Exchange` instance :param routing_key: routing key - :param arguments: additional arguments (will be passed to `pika`) + :param arguments: additional arguments :param timeout: execution timeout :raises asyncio.TimeoutError: when the unbinding timeout period has elapsed. @@ -181,7 +181,7 @@ async def consume( be accessed by the current connection, and are deleted when that connection closes. Passive declaration of an exclusive queue by other connections are not allowed. - :param arguments: extended arguments for pika + :param arguments: additional arguments :param consumer_tag: optional consumer tag :raises asyncio.TimeoutError: diff --git a/aio_pika/robust_connection.py b/aio_pika/robust_connection.py index a8046229..56e57f82 100644 --- a/aio_pika/robust_connection.py +++ b/aio_pika/robust_connection.py @@ -202,24 +202,18 @@ async def main(): will be used keyword arguments. :param host: hostname of the broker :param port: broker port 5672 by default - :param login: - username string. `'guest'` by default. Provide empty string - for pika.credentials.ExternalCredentials usage. + :param login: username string. `'guest'` by default. :param password: password string. `'guest'` by default. :param virtualhost: virtualhost parameter. `'/'` by default - :param ssl: - use SSL for connection. Should be used with addition kwargs. - See `pika documentation`_ for more info. + :param ssl: use SSL for connection. Should be used with addition kwargs. :param ssl_options: A dict of values for the SSL connection. :param loop: Event loop (:func:`asyncio.get_event_loop()` when :class:`None`) :param connection_class: Factory of a new connection - :param kwargs: - addition parameters which will be passed to the pika connection. + :param kwargs: addition parameters which will be passed to the connection. :return: :class:`aio_pika.connection.Connection` .. _RFC3986: https://goo.gl/MzgYAs - .. _pika documentation: https://goo.gl/TdVuZ9 .. _official Python documentation: https://goo.gl/pty9xA """ diff --git a/aio_pika/tools.py b/aio_pika/tools.py index 5343925d..71ac1ead 100644 --- a/aio_pika/tools.py +++ b/aio_pika/tools.py @@ -12,7 +12,7 @@ def iscoroutinepartial(fn): """ - Function returns True if function it's a partial instance of coroutine. + Function returns True if function is a partial instance of coroutine. See additional information here_. :param fn: Function diff --git a/docs/source/conf.py b/docs/source/conf.py index 4c8214f4..76207236 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -112,7 +112,7 @@ # html_theme_options = {} html_theme_options = { 'codecov_button': True, - 'description': 'Wrapper for the PIKA for asyncio and humans', + 'description': 'Wrapper for the aiormq for asyncio and humans', 'github_banner': True, 'github_button': True, 'github_repo': 'aio-pika', diff --git a/docs/source/index.rst b/docs/source/index.rst index 74d8589a..ebe34c43 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,9 +3,9 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -.. _aio_pika: https://github.com/mosquito/aio-pika +.. _aio-pika: https://github.com/mosquito/aio-pika .. _asyncio: https://docs.python.org/3/library/asyncio.html -.. _PIKA: https://github.com/pika/pika +.. _aiormq: http://github.com/mosquito/aiormq/ Welcome to aio-pika's documentation! @@ -33,7 +33,7 @@ Welcome to aio-pika's documentation! :target: https://pypi.python.org/pypi/aio-pika/ -`aio_pika`_ it's a wrapper for the `PIKA`_ for `asyncio`_ and humans. +`aio-pika`_ is a wrapper for the `aiormq`_ for `asyncio`_ and humans. Features @@ -80,13 +80,13 @@ Clone the project: cd aio-pika -Create a new virtualenv for `aio_pika`_: +Create a new virtualenv for `aio-pika`_: .. code-block:: shell virtualenv -p python3.5 env -Install all requirements for `aio_pika`_: +Install all requirements for `aio-pika`_: .. code-block:: shell diff --git a/docs/source/patterns.rst b/docs/source/patterns.rst index c6ab4962..b68a011c 100644 --- a/docs/source/patterns.rst +++ b/docs/source/patterns.rst @@ -1,4 +1,4 @@ -.. _aio_pika: https://github.com/mosquito/aio-pika +.. _aio-pika: https://github.com/mosquito/aio-pika Patterns and helpers @@ -6,7 +6,7 @@ Patterns and helpers .. note:: Available since `aio-pika>=1.7.0` -`aio_pika`_ includes some useful patterns for creating distributed systems. +`aio-pika`_ includes some useful patterns for creating distributed systems. .. _patterns-worker: diff --git a/docs/source/rabbitmq-tutorial/1-introduction.rst b/docs/source/rabbitmq-tutorial/1-introduction.rst index bc9f6064..b28ea513 100644 --- a/docs/source/rabbitmq-tutorial/1-introduction.rst +++ b/docs/source/rabbitmq-tutorial/1-introduction.rst @@ -194,7 +194,7 @@ command as many times as we like, and only one will be created. .. note:: This article contains adopted official examples only. - But `aio_pika` allows to use Python 3.5+ `async for` notation. + But `aio-pika` allows to use Python 3.5+ `async for` notation. For example: