Skip to content

Commit c9559a6

Browse files
author
aezell
committed
An initial clean up of the sphinx docs.
Docstring cleanup to be implemented in a later commit.
1 parent dd122b4 commit c9559a6

File tree

6 files changed

+69
-37
lines changed

6 files changed

+69
-37
lines changed

docs/source/conf.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# serve to show the default.
1313

1414
import sys, os
15+
from pyres import __version__
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
@@ -37,17 +38,17 @@
3738
master_doc = 'index'
3839

3940
# General information about the project.
40-
project = u'PyRes'
41+
project = u'pyres'
4142
copyright = u'2010, Matt George'
4243

4344
# The version info for the project you're documenting, acts as replacement for
4445
# |version| and |release|, also used in various other places throughout the
4546
# built documents.
4647
#
4748
# The short X.Y version.
48-
version = '0.4.1'
49+
version = __version__
4950
# The full version, including alpha/beta/rc tags.
50-
release = '0.4.1'
51+
release = __version__
5152

5253
# The language for content autogenerated by Sphinx. Refer to documentation
5354
# for a list of supported languages.
@@ -158,7 +159,7 @@
158159
#html_file_suffix = ''
159160

160161
# Output file base name for HTML help builder.
161-
htmlhelp_basename = 'PyResdoc'
162+
htmlhelp_basename = 'pyresdoc'
162163

163164

164165
# -- Options for LaTeX output --------------------------------------------------
@@ -172,7 +173,7 @@
172173
# Grouping the document tree into LaTeX files. List of tuples
173174
# (source start file, target name, title, author, documentclass [howto/manual]).
174175
latex_documents = [
175-
('index', 'PyRes.tex', u'PyRes Documentation',
176+
('index', 'pyres.tex', u'pyres Documentation',
176177
u'Matt George', 'manual'),
177178
]
178179

docs/source/example.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
=========
2-
EXAMPLE
1+
Example
32
=========
43

54
Let's take a real wold example of a blog where comments need to be checked for
6-
spam check. When the comment is saved in the database, we create a job in the
7-
queue with comment data. Let's take a django model in this case.
5+
spam. When the comment is saved in the database, we create a job in the
6+
queue with that comment data. Let's take a django model in this case.
87

98
.. code-block:: python
109
:linenos:
@@ -30,10 +29,10 @@ queue with comment data. Let's take a django model in this case.
3029
comment.spam = False
3130
comment.save()
3231
33-
You can convert your existing class to be compatible with Pyres. All you need
34-
to do is add a @queue@ variable and define a @perform@ method on the class.
32+
You can convert your existing class to be compatible with pyres. All you need
33+
to do is add a :attr:`queue` attribute and define a :meth:`perform` method on the class.
3534

36-
To insert a job into the queue you need to do something like this:::
35+
To insert a job into the queue you need to do something like this::
3736

3837
from pyres import ResQ
3938
r = Resq()

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.. PyRes documentation master file, created by
1+
.. pyres documentation master file, created by
22
sphinx-quickstart on Wed Jan 6 15:11:19 2010.
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to PyRes's documentation!
6+
Welcome to pyres's documentation!
77
=================================
88

99
Contents:

docs/source/install.rst

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
11
Installation
22
===============
33

4-
Requirements:
5-
--------------
6-
simplejson>=2.0.9
7-
itty>=0.6.2
8-
redis>=0.6.0
9-
pystache>=0.1.0
4+
Pyres is most easily installed using pip and can be found on PyPI as pyres_.
105

11-
Make sure you install these requirements before proceeding.
6+
Using ``pip install pyres`` will install the required versions of the above packages/modules.
7+
Those requirements are currently:
128

13-
.. todo:: Need to point to notes on redis installation and get python-redis.
9+
::
1410

15-
16-
To install pyres.::
11+
simplejson==2.0.9
12+
itty==0.6.4
13+
redis==1.34.1
14+
pystache==0.2.0
15+
16+
If you'd rather install from the git repository, that's easy too::
1717

1818
$ git clone git://github.com/binarydud/pyres.git
1919
$ cd pyres
2020
$ python setup.py build
2121
$ python setup.py install
2222

23-
Might need to run as sudo to install.
23+
Of course, you'll need to install the Redis server as well. Below is a simple example, but
24+
please read `Redis's own documentation`_ for more details.
25+
26+
::
27+
28+
$ wget http://redis.googlecode.com/files/redis-1.2.2.tar.gz
29+
$ tar -xvf redis-1.2.2.tar.gz
30+
$ cd redis-1.2.2
31+
$ make
32+
$ ./redis-server
33+
34+
This will install and start a Redis server with the default config running on port 6379.
35+
This default config is good enough for you to run the pyres tests.
36+
37+
.. _pyres: http://pypi.python.org/pypi/pyres/
38+
.. _Redis's own documentation: http://code.google.com/p/redis/wiki/index?tm=6
2439

2540

2641

docs/source/intro.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
Introduction
22
============
33

4-
PyRes is a resque_ clone built in python. Resque is used by Github as their
5-
message queue. Read_ the blog post from github about how they use resque in
6-
production.
4+
Pyres is a resque_ clone built in python. Resque is used by Github as their
5+
message queue. Both use Redis_ as the queue backend and provide a web-based
6+
monitoring application.
77

8-
:synopsis: Any job which takes a little while to run can be put on a message
9-
queue. Read our :doc:`Example </example>` implementation of how a PyRes can be used to spam check comments.
8+
Read_ the blog post from github about how they use resque in production.
9+
10+
:synopsis: Put jobs (which can be any kind of class) on a queue and process them while watching the progress via your browser.
11+
12+
Read our :doc:`example implementation </example>` of how pyres can be used to spam check comments.
1013

1114

1215
.. _resque: http://github.com/defunkt/resque#readme
1316
.. _Read: http://github.com/blog/542-introducing-resque
14-
17+
.. _Redis: http://code.google.com/p/redis/

docs/source/tests.rst

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
Tests
22
=======
33

4-
PyRes comes with a test suite which connects to a local redis server and
5-
creates a couple of *Queues* and *jobs*.
4+
Pyres comes with a test suite which connects to a local Redis server and
5+
creates a couple of *queues* and *jobs*.
66

7-
To run tests make sure you have nose_ installed.::
7+
Make sure you have nose_ installed::
88

9-
$ easy_install nose
10-
$ redis-server [PATH_TO_YOUR_REDIS_CONFIG]
11-
$ nosetests
9+
$ pip install nose
10+
11+
Also make sure your Redis server is running::
12+
13+
$ cd path_to_redis_installation
14+
$ ./redis-server [PATH_TO_YOUR_REDIS_CONFIG]
15+
16+
If you don't give the ``./redis-server`` command the config path, it will use a default config, which should run the tests just fine.
17+
18+
Now, we're ready to run the tests. From the pyres install directory::
19+
20+
$ nosetests
21+
............................................
22+
----------------------------------------------------------------------
23+
Ran 44 tests in 0.901s
24+
25+
OK
1226

1327
Add **-v** flag if you want verbose output.
1428

0 commit comments

Comments
 (0)