Skip to content

Commit e9bfde7

Browse files
committed
Spell-check
1 parent 25fb0c7 commit e9bfde7

16 files changed

+94
-45
lines changed

FAQ

+2-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ Questions
77

88
Q: Message.reject doesn't work?
99
--------------------------------------
10-
**Answer**: RabbitMQ (as of v1.5.5) has not implemented reject yet.
11-
There was a brief discussion about it on their mailing list, and the reason
12-
why it's not implemented yet is revealed:
13-
14-
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2009-January/003183.html
10+
**Answer**: Earlier versions of RabbitMQ did not implement ``basic.reject``,
11+
so make sure your version is recent enough to support it.
1512

1613
Q: Message.requeue doesn't work?
1714
--------------------------------------

README.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Features
4242
* Consistent exception handling across transports.
4343

4444
* The ability to ensure that an operation is performed by gracefully
45-
handling connection and channel errrors.
45+
handling connection and channel errors.
4646

4747
* Several annoyances with `amqplib`_ has been fixed, like supporting
4848
timeouts and the ability to wait for events on more than one channel.
@@ -148,7 +148,7 @@ Quick overview
148148
connection.drain_events()
149149

150150

151-
Or handle channels menually::
151+
Or handle channels manually::
152152

153153
with connection.channel() as channel:
154154
producer = Producer(channel, ...)
@@ -177,7 +177,7 @@ just remember to close the objects after use::
177177

178178

179179
`Exchange` and `Queue` are simply declarations that can be pickled
180-
and used in configuaration files etc.
180+
and used in configuration files etc.
181181

182182
They also support operations, but to do so they need to be bound
183183
to a channel:

docs/userguide/connections.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ method::
2525

2626
>>> connection.connect()
2727

28-
You can also check wether the connection is connected::
28+
You can also check whether the connection is connected::
2929

3030
>>> connection.connected()
3131
True
@@ -37,7 +37,7 @@ Connections must always be closed after use::
3737
But best practice is to release the connection instead,
3838
this will release the resource if the connection is associated
3939
with a connection pool, or close the connection if not,
40-
and makes it easier to transist to connection pools later::
40+
and makes it easier to do the transition to connection pools later::
4141

4242
>>> connection.release()
4343

@@ -83,7 +83,7 @@ The query part of the URL can also be used to set options, e.g.::
8383
See :ref:`connection-options` for a list of supported options.
8484

8585
A connection without options will use the default connection settings,
86-
which is using the localhost host, default port, username `guest`,
86+
which is using the localhost host, default port, user name `guest`,
8787
password `guest` and virtual host "/". A connection without arguments
8888
is the same as::
8989

@@ -103,8 +103,8 @@ Keyword arguments
103103
The :class:`BrokerConnection` class supports additional
104104
keyword arguments, these are:
105105

106-
:hostname: Default hostname if not provided in the URL.
107-
:userid: Default username if not provided in the URL.
106+
:hostname: Default host name if not provided in the URL.
107+
:userid: Default user name if not provided in the URL.
108108
:password: Default password if not provided in the URL.
109109
:virtual_host: Default virtual host if not provided in the URL.
110110
:port: Default port if not provided in the URL.
@@ -113,15 +113,15 @@ keyword arguments, these are:
113113
``kombu.transport.pyamqplib.Transport``), or one of the aliases:
114114
``amqplib``, ``pika``, ``redis``, ``memory``, and so on.
115115

116-
:ssl: Use ssl to connect to the server. Default is ``False``.
116+
:ssl: Use SSL to connect to the server. Default is ``False``.
117117
Only supported by the amqp transport.
118118
:insist: Insist on connecting to a server.
119119
In a configuration with multiple load-sharing servers, the insist
120120
option tells the server that the client is insisting on a connection
121121
to the specified server. Default is ``False``.
122122
Only supported by the amqp and pika transports, and not by AMQP 0-9-1.
123123
:connect_timeout: Timeout in seconds for connecting to the
124-
server. May not be suported by the specified transport.
124+
server. May not be supported by the specified transport.
125125
:transport_options: A dict of additional connection arguments to
126126
pass to alternate kombu channel implementations. Consult the transport
127127
documentation for available options.

docs/userguide/consumers.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. currentmodule:: kombu.messaging
2+
.. _guide-consumers:
3+
4+
===========
5+
Consumers
6+
===========
7+
8+
.. _consumer-basics:
9+
10+
Basics
11+
======
12+
13+
14+
Reference
15+
=========
16+
17+
.. module:: kombu.messaging
18+
19+
.. autoclass:: Consumer
20+
:noindex:
21+
:members:

docs/userguide/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
:maxdepth: 2
1010

1111
connections
12+
producers
13+
consumers
1214
examples
1315
simple
1416
pools

docs/userguide/producers.rst

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. currentmodule:: kombu.messaging
2+
.. _guide-producers:
3+
4+
===========
5+
Producers
6+
===========
7+
8+
.. _producer-basics:
9+
10+
Basics
11+
======
12+
13+
14+
Serialization
15+
=============
16+
17+
See :ref:`guide-serialization`.
18+
19+
20+
Reference
21+
=========
22+
23+
.. module:: kombu.messaging
24+
25+
.. autoclass:: Producer
26+
:noindex:
27+
:members:

docs/userguide/serialization.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Each option has its advantages and disadvantages.
2727
`simplejson`.
2828

2929
The primary disadvantage to `JSON` is that it limits you to
30-
the following data types: strings, unicode, floats, boolean,
30+
the following data types: strings, Unicode, floats, boolean,
3131
dictionaries, and lists. Decimals and dates are notably missing.
3232

33-
Also, binary data will be transferred using base64 encoding, which
33+
Also, binary data will be transferred using Base64 encoding, which
3434
will cause the transferred data to be around 34% larger than an
3535
encoding which supports native binary types.
3636

@@ -79,16 +79,17 @@ Sending raw data without Serialization
7979
======================================
8080

8181
In some cases, you don't need your message data to be serialized. If you
82-
pass in a plain string or unicode object as your message, then carrot will
82+
pass in a plain string or Unicode object as your message, then carrot will
8383
not waste cycles serializing/deserializing the data.
8484

8585
You can optionally specify a `content_type` and `content_encoding`
8686
for the raw data::
8787

88-
>>> producer.send(open('~/my_picture.jpg','rb').read(),
89-
content_type="image/jpeg",
90-
content_encoding="binary",
91-
routing_key=rkey)
88+
>>> with open("~/my_picture.jpg", "rb") as fh:
89+
... producer.publish(fh.read(),
90+
content_type="image/jpeg",
91+
content_encoding="binary",
92+
routing_key=rkey)
9293

9394
The `Message` object returned by the `Consumer` class will have a
9495
`content_type` and `content_encoding` attribute.

kombu/abstract.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
class Object(object):
17-
"""Common baseclass supporting automatic kwargs->attributes handling,
17+
"""Common base class supporting automatic kwargs->attributes handling,
1818
and cloning."""
1919
attrs = ()
2020

@@ -63,7 +63,7 @@ def maybe_bind(self, channel):
6363
return self
6464

6565
def revive(self, channel):
66-
"""Revive channel afer connection re-established.
66+
"""Revive channel after the connection has been re-established.
6767
6868
Used by :meth:`~kombu.connection.BrokerConnection.ensure`.
6969

kombu/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Broadcast(entity.Queue):
3131
"""Convenience class used to define broadcast queues.
3232
3333
Every queue instance will have a unique name,
34-
and both the queue and exchange is configued with auto deletion.
34+
and both the queue and exchange is configured with auto deletion.
3535
3636
:keyword name: This is used as the name of the exchange.
3737
:keyword queue: By default a unique id is used for the queue

kombu/connection.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ class BrokerConnection(object):
6363
6464
:param URL: Connection URL.
6565
66-
:keyword hostname: Default Hostname/address if not provided in the URL.
67-
:keyword userid: Default username if not provided in the URL.
66+
:keyword hostname: Default host name/address if not provided in the URL.
67+
:keyword userid: Default user name if not provided in the URL.
6868
:keyword password: Default password if not provided in the URL.
6969
:keyword virtual_host: Default virtual host if not provided in the URL.
7070
:keyword port: Default port if not provided in the URL.
71-
:keyword ssl: Use ssl to connect to the server. Default is ``False``.
71+
:keyword ssl: Use SSL to connect to the server. Default is ``False``.
7272
May not be supported by the specified transport.
7373
:keyword transport: Default transport if not specified in the URL.
7474
:keyword connect_timeout: Timeout in seconds for connecting to the
75-
server. May not be suported by the specified transport.
75+
server. May not be supported by the specified transport.
7676
:keyword transport_options: A dict of additional connection arguments to
7777
pass to alternate kombu channel implementations. Consult the transport
7878
documentation for available options.
@@ -167,7 +167,7 @@ def drain_events(self, **kwargs):
167167
"""Wait for a single event from the server.
168168
169169
:keyword timeout: Timeout in seconds before we give up.
170-
Raises :exc:`socket.timeout` if the timeout is execeded.
170+
Raises :exc:`socket.timeout` if the timeout is exceeded.
171171
172172
Usually used from an event loop.
173173
@@ -234,7 +234,7 @@ def revive(self, new_channel):
234234
def ensure(self, obj, fun, errback=None, max_retries=None,
235235
interval_start=1, interval_step=1, interval_max=1, on_revive=None):
236236
"""Ensure operation completes, regardless of any channel/connection
237-
errors occuring.
237+
errors occurring.
238238
239239
Will retry by establishing the connection, and reapplying
240240
the function.
@@ -569,7 +569,7 @@ def default_channel(self):
569569

570570
@property
571571
def host(self):
572-
"""The host as a hostname/port pair separated by colon."""
572+
"""The host as a host name/port pair separated by colon."""
573573
return ":".join([self.hostname, str(self.port)])
574574

575575
@property

kombu/entity.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def delete(self, if_unused=False, if_empty=False, nowait=False):
479479
if the queue has consumers.
480480
481481
:keyword if_empty: If set, the server will only delete the queue
482-
if it is empty. If if's not empty a channel error will be raised.
482+
if it is empty. If it is not empty a channel error will be raised.
483483
484484
:keyword nowait: Do not wait for a reply.
485485

kombu/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ConnectionLimitExceeded(LimitExceeded):
3636

3737

3838
class ChannelLimitExceeded(LimitExceeded):
39-
"""Maximum number of simultaenous channels exceeded."""
39+
"""Maximum number of simultaneous channels exceeded."""
4040
pass
4141

4242

kombu/messaging.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from kombu.syn import blocking as _SYN
1717
from kombu.utils import maybe_list
1818

19+
1920
Exchange = entity.Exchange
2021
Queue = entity.Queue
2122

@@ -109,9 +110,9 @@ def publish(self, body, routing_key=None, delivery_mode=None,
109110
:keyword mandatory: Currently not supported.
110111
:keyword immediate: Currently not supported.
111112
:keyword priority: Message priority. A number between 0 and 9.
112-
:keyword content_type: Content type. Default is autodetect.
113-
:keyword content_encoding: Content encoding. Default is autodetect.
114-
:keyword serializer: Serializer to use. Default is autodetect.
113+
:keyword content_type: Content type. Default is auto-detect.
114+
:keyword content_encoding: Content encoding. Default is auto-detect.
115+
:keyword serializer: Serializer to use. Default is auto-detect.
115116
:keyword headers: Mapping of arbitrary headers to pass along
116117
with the message body.
117118
:keyword exchange: Override the exchange. Note that this exchange
@@ -223,7 +224,7 @@ class Consumer(object):
223224
#:
224225
#: The signature of the callback must take two arguments: `(message,
225226
#: exc)`, which is the message that can't be decoded and the exception
226-
#: that occured while trying to decode it.
227+
#: that occurred while trying to decode it.
227228
on_decode_error = None
228229

229230
_next_tag = count(1).next # global

kombu/pidbox.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _broadcast(self, command, arguments=None, destination=None,
212212
raise ValueError("destination must be a list/tuple not %s" % (
213213
type(destination)))
214214

215-
# Set reply limit to number of destinations (if specificed)
215+
# Set reply limit to number of destinations (if specified)
216216
if limit is None and destination:
217217
limit = destination and len(destination) or None
218218

kombu/serialization.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ def encode(self, data, serializer=None):
111111
"No encoder installed for %s" % serializer)
112112

113113
# If a raw string was sent, assume binary encoding
114-
# (it's likely either ASCII or a raw binary file, but 'binary'
115-
# charset will encompass both, even if not ideal.
114+
# (it's likely either ASCII or a raw binary file, and a character
115+
# set of 'binary' will encompass both, even if not ideal.
116116
if not serializer and isinstance(data, bytes_type):
117117
# In Python 3+, this would be "bytes"; allow binary data to be
118118
# sent as a message without getting encoder errors
119119
return "application/data", "binary", data
120120

121-
# For unicode objects, force it into a string
121+
# For Unicode objects, force it into a string
122122
if not serializer and isinstance(data, unicode):
123123
payload = data.encode("utf-8")
124124
return "text/plain", "utf-8", payload
@@ -138,7 +138,7 @@ def decode(self, data, content_type, content_encoding):
138138
content_type = content_type or 'application/data'
139139
content_encoding = (content_encoding or 'utf-8').lower()
140140

141-
# Don't decode 8-bit strings or unicode objects
141+
# Don't decode 8-bit strings or Unicode objects
142142
if content_encoding not in ('binary', 'ascii-8bit') and \
143143
not isinstance(data, unicode):
144144
data = _decode(data, content_encoding)

kombu/utils/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def uuid4():
5151

5252
def uuid():
5353
"""Generate a unique id, having - hopefully - a very small chance of
54-
collission.
54+
collision.
5555
5656
For now this is provided by :func:`uuid.uuid4`.
5757
"""
@@ -65,7 +65,7 @@ def kwdict(kwargs):
6565
return kwargs
6666
else:
6767
def kwdict(kwargs): # noqa
68-
"""Make sure keyword arguments are not in unicode.
68+
"""Make sure keyword arguments are not in Unicode.
6969
7070
This should be fixed in newer Python versions,
7171
see: http://bugs.python.org/issue4978.

0 commit comments

Comments
 (0)