Skip to content

Commit

Permalink
Fix the docs for real [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
gmr committed Oct 28, 2016
1 parent 123d49b commit 109e443
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 32 deletions.
8 changes: 1 addition & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rabbitpy: RabbitMQ Simplified
=============================
rabbitpy is a pure python, thread-safe [#]_, and pythonic BSD Licensed AMQP/RabbitMQ library that supports Python 2.6+ and 3.2+. rabbitpy aims to provide a simple and easy to use API for interfacing with RabbitMQ, minimizing the programming overhead often found in other libraries.

|Version| |Downloads| |License|
|Version|

Installation
------------
Expand Down Expand Up @@ -69,9 +69,3 @@ Indices and tables

.. |Version| image:: https://badge.fury.io/py/rabbitpy.svg?
:target: http://badge.fury.io/py/rabbitpy

.. |Downloads| image:: https://pypip.in/d/rabbitpy/badge.svg?
:target: https://pypi.python.org/pypi/rabbitpy

.. |License| image:: https://pypip.in/license/rabbitpy/badge.svg?
:target: https://rabbitpy.readthedocs.org
47 changes: 22 additions & 25 deletions rabbitpy/amqp_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Queue(base.AMQPClass):
"""Create and manage RabbitMQ queues.
:param channel: The channel object to communicate on
:type channel: :class:`~rabbitpy.channel.Channel`
:type channel: :py:class:`~rabbitpy.Channel`
:param str name: The name of the queue
:param exclusive: Queue can only be used by this channel and will
auto-delete once the channel is closed.
Expand All @@ -60,8 +60,8 @@ class Queue(base.AMQPClass):
:type dead_letter_routing_key: str
:param dict arguments: Custom arguments for the queue
:raises: :exc:`~rabbitpy.exceptions.RemoteClosedChannelException`
:raises: :exc:`~rabbitpy.exceptions.RemoteCancellationException`
:raises: :py:exc:`~rabbitpy.exceptions.RemoteClosedChannelException`
:raises: :py:exc:`~rabbitpy.exceptions.RemoteCancellationException`
"""
arguments = dict()
Expand All @@ -81,12 +81,12 @@ def __init__(self, channel, name='',
dead_letter_exchange=None, dead_letter_routing_key=None,
arguments=None):
"""Create a new Queue object instance. Only the
:class:`rabbitpy.Channel` object is required.
:py:class:`rabbitpy.Channel` object is required.
.. warning:: You should only use a single
`:class:~rabbitpy.amqp_queue.Queue` instance per channel
when consuming or getting messages. Failure to do so can
have unintended consequences.
:py:class:`~rabbitpy.Queue` instance per channel
when consuming or getting messages. Failure to do so can
have unintended consequences.
"""
super(Queue, self).__init__(channel, name)
Expand All @@ -107,15 +107,14 @@ def __init__(self, channel, name='',
self.dead_letter_routing_key = dead_letter_routing_key

def __iter__(self):
"""Quick way to consume messages using defaults of no_ack=False,
"""Quick way to consume messages using defaults of ``no_ack=False``,
prefetch and priority not set.
.. warning:: You should only use a single
`:class:~rabbitpy.amqp_queue.Queue` instance per channel
when consuming messages. Failure to do so can
have unintended consequences.
.. warning:: You should only use a single :py:class:`~rabbitpy.Queue`
instance per channel when consuming messages. Failure to do so can
have unintended consequences.
:yields: rabbitpy.message.Message
:yields: :class:`~rabbitpy.Message`
"""
return self.consume()
Expand Down Expand Up @@ -191,17 +190,15 @@ def consume(self, no_ack=False, prefetch=None, priority=None):
.. versionadded:: 0.26
.. warning:: You should only use a single
`:class:~rabbitpy.amqp_queue.Queue` instance per channel
when consuming messages. Failure to do so can
have unintended consequences.
.. warning:: You should only use a single :py:class:`~rabbitpy.Queue`
instance per channel when consuming messages. Failure to do so can
have unintended consequences.
:param bool no_ack: Do not require acknowledgements
:param int prefetch: Set a prefetch count for the channel
:param int priority: Consumer priority
:rtype: :py:class:`generator`
:raises: rabbitpy.exceptions.RemoteCancellationException
:raises: :exc:`~rabbitpy.exceptions.RemoteCancellationException`
"""
self._consume(no_ack, prefetch, priority)
Expand Down Expand Up @@ -235,7 +232,7 @@ def consume_messages(self, no_ack=False, prefetch=None, priority=None):
:param int prefetch: Set a prefetch count for the channel
:param int priority: Consumer priority
:rtype: :py:class:`Generator`
:raises: rabbitpy.exceptions.RemoteCancellationException
:raises: :exc:`~rabbitpy.exceptions.RemoteCancellationException`
"""
warnings.warn('This method is deprecated in favor Queue.consume',
Expand Down Expand Up @@ -291,15 +288,15 @@ def get(self, acknowledge=True):
"""Request a single message from RabbitMQ using the Basic.Get AMQP
command.
.. warning:: You should only use a single
`:class:~rabbitpy.amqp_queue.Queue` instance per channel
when getting messages. Failure to do so can have
unintended consequences.
.. warning:: You should only use a single :py:class:`~rabbitpy.Queue`
instance per channel when getting messages. Failure to do so can
have unintended consequences.
:param bool acknowledge: Let RabbitMQ know if you will manually
acknowledge or negatively acknowledge the
message after each get.
:rtype: rabbitpy.message.Message or None
:rtype: :class:`~rabbitpy.Message` or None
"""
self._write_frame(specification.Basic.Get(queue=self.name,
Expand Down

0 comments on commit 109e443

Please sign in to comment.