summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Higgins <gjh@bel-epa.com>2009-07-02 04:31:16 +0100
committerGraham Higgins <gjh@bel-epa.com>2009-07-02 04:31:16 +0100
commitbc2649246f76b76f245ebae6d597223baa10f595 (patch)
tree8c454b5f7b75ebd31055301870504f57cc1bbef7
parent265345f9b66c6dfc3fe3fa32435049e4e09d3d4e (diff)
downloadroutes-bc2649246f76b76f245ebae6d597223baa10f595.tar.gz
Docs migration from pudge to sphinx
--HG-- branch : trunk
-rw-r--r--.hgignore2
-rw-r--r--CHANGELOG140
-rw-r--r--docs/_templates/index.html74
-rw-r--r--docs/_templates/indexsidebar.html19
-rw-r--r--docs/_templates/layout.html11
-rw-r--r--docs/changes.rst8
-rw-r--r--docs/community/index.txt12
-rw-r--r--docs/conf.py80
-rw-r--r--docs/contents.rst31
-rw-r--r--docs/docs/index.txt11
-rw-r--r--docs/download/index.txt21
-rw-r--r--docs/glossary.rst7
-rw-r--r--docs/index.rst297
-rw-r--r--docs/index.txt292
-rw-r--r--docs/manual.txt766
-rw-r--r--docs/modules.rst22
-rw-r--r--docs/pudge_template/SyntaxHighlighter.css249
-rw-r--r--docs/pudge_template/layout.css120
-rw-r--r--docs/pudge_template/layout.html113
-rw-r--r--docs/pudge_template/pudge.css60
-rw-r--r--docs/pudge_template/rst.css387
-rw-r--r--docs/pudge_template/site.css290
-rw-r--r--docs/recipes.txt32
-rw-r--r--routes/__init__.py26
24 files changed, 631 insertions, 2439 deletions
diff --git a/.hgignore b/.hgignore
index d157a5f..66f46d3 100644
--- a/.hgignore
+++ b/.hgignore
@@ -1,5 +1,6 @@
# Automatically generated by `hgimportsvn`
+.DS_Store
syntax:glob
.svn
*.pyc
@@ -8,3 +9,4 @@ syntax:glob
build
dist
docs/_build
+.hgignore
diff --git a/CHANGELOG b/CHANGELOG
index 89ee4b4..50952bd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,26 +1,31 @@
Routes Changelog
-========================
+================
--- 1.11 (**tip**)
+Release 1.11 (**tip**)
+======================
* Added optional LRU object for use with Routes when URL's change too often
for the Routes urlcache dict to be a viable option.
--- 1.10.3 (February 8, 2009)
+Release 1.10.3 (February 8, 2009)
+=================================
* Tweak to use WebOb Request rather than Paste.
* Performance tweaks for URL recognition.
* Bugfix for routes.middleware not re.escaping the path_info before moving it
to the script name.
--- 1.10.2 (January 11, 2009)
+Release 1.10.2 (January 11, 2009)
+=================================
* Bugfix for unicode encoding problems with non-minimized Route generation.
Spotted by Wichert Akkerman.
* Bugfix for when environ is {} in unit tests.
--- 1.10.1 (September 27, 2008)
+Release 1.10.1 (September 27, 2008)
+===================================
* Removing LRU cache due to performance and threading issues. Cache does hit
a max-size for the given routes.
--- 1.10 (September 24, 2008)
+Release 1.10 (September 24, 2008)
+=================================
* Adding LRU cache instead of just dict for caching generated routes. This
avoids slow memory leakage over long-running and non-existent route
generation.
@@ -31,15 +36,18 @@ Routes Changelog
* Added sub_domain condition option to accept False or None, to require that
there be no sub-domain provided for the route to match.
--- 1.9.2 (July 8, 2008)
+Release 1.9.2 (July 8, 2008)
+============================
* Fixed bug in url_for which caused it to return a literal when it shouldn't
have.
--- 1.9.1 (June 28, 2008)
+Release 1.9.1 (June 28, 2008)
+=============================
* Fixed bug in formatted route recognition with formatting being absorbed
into the id.
--- 1.9 (June 12, 2008)
+Release 1.9 (June 12, 2008)
+===========================
* Fix undefined arg bug in url_for.
* Fixed bug with url_for not working properly outside of a request when
sub-domains are active. Thanks Pavel Skvazh.
@@ -62,7 +70,8 @@ Routes Changelog
* Fixed Mapper.create_regs not being thread safe, particularly when
always_scan=True.
--- 1.8 (March 28, 2008)
+Release 1.8 (March 28, 2008)
+============================
* Fixed bug of map.resource not allowing spaces in id.
* Fixed url generation to properly handle unicode defaults in addition to
unicode arguments.
@@ -72,14 +81,17 @@ Routes Changelog
normal '/'. This means that formatted URL's will also now have the format
come AFTER the action. Ie: /messsages/4.xml;rss -> /messages/4/rss.xml
--- 1.7.3 (May 28th, 2008)
+Release 1.7.3 (May 28th, 2008)
+==============================
* Fixed triple escaping bug, since WSGI servers are responsible for basic
unescaping.
--- 1.7.2 (Feb. 27th, 2008)
+Release 1.7.2 (Feb. 27th, 2008)
+===============================
* Fixed bug with keyword args not being coerced to raw string properly.
--- 1.7.1 (Nov. 16th, 2007)
+Release 1.7.1 (Nov. 16th, 2007)
+===============================
* Fixed bug with sub-domains from route defaults getting encoded to unicode
resulting in a unicode route which then caused url_for to throw an
exception.
@@ -93,7 +105,8 @@ Routes Changelog
* Fixed the special '_method' attribute not being recognized during POST
requests of Content-Type 'multipart/form-data'.
--- 1.7 (June 8th, 2007)
+Release 1.7 (June 8th, 2007)
+============================
* Fixed url_unquoting to only apply for strings.
* Added _encoding option to individual routes to toggle decoding/encoding on a
per route basis.
@@ -112,7 +125,8 @@ Routes Changelog
application/x-www-form-urlencoded for a HTML form. This properly avoids
parsing wsgi.input when it doesn't need to be.
--- 1.6.3 (April 10th, 2007)
+Release 1.6.3 (April 10th, 2007)
+================================
* Fixed matching so that an attempt to match an empty path raises a
RouteException. Fixes #44.
* Added ability to use characters in URL's such as '-' and '_' in
@@ -158,16 +172,19 @@ Routes Changelog
* Applied patch to generation and matching to handle Unicode characters
properly. Reported with patch by David Smith.
--- 1.6.2 (Jan. 5, 2007)
+Release 1.6.2 (Jan. 5, 2007)
+============================
* Fixed issue with method checking not properly handling different letter
cases in REQUEST_METHOD. Reported by Sean Davis.
* redirect_to now supports config.redirect returning a redirect, not just
raising one.
--- 1.6.1 (Dec. 29, 2006)
+Release 1.6.1 (Dec. 29, 2006)
+=============================
* Fixed zipsafe flag to be False.
--- 1.6 (Dec. 14th, 2006)
+Release 1.6 (Dec. 14th, 2006)
+=============================
* Fixed append_slash to take effect in the route generation itself instead of
relying on url_for function. Reported by ToddG.
* Added additional url_for tests to ensure map.resource generates proper named
@@ -182,18 +199,21 @@ Routes Changelog
* Added _absolute keyword option route connect to ignore SCRIPT_NAME settings.
Suggested by Ian Bicking.
--- 1.5.2 (Oct. 16th, 2006)
+Release 1.5.2 (Oct. 16th, 2006)
+===============================
* Fixed qualified keyword to keep host port names when used, unless a host
is specifically passed in. Reported by Jon Rosebaugh.
* Added qualified keyword option to url_for to have it generate a full
URL. Resolves #29.
* Fixed examples in url_for doc strings so they'll be accurate.
--- 1.5.1 (Oct. 4th, 2006)
+Release 1.5.1 (Oct. 4th, 2006)
+==============================
* Fixed bug with escaping part names in the regular expression, reported by
James Taylor.
--- 1.5 (Sept. 19th, 2006)
+Release 1.5 (Sept. 19th, 2006)
+==============================
* Significant updates to map.resource and unit tests that comb it thoroughly
to ensure its creating all the proper routes (it now is). Increased unit
testing coverage to 95%.
@@ -213,7 +233,8 @@ Routes Changelog
* Changed order in which sub-domain is added to match-dict so it can be used
in a conditions function.
--- 1.4.1 (Sept. 6th, 2006)
+Release 1.4.1 (Sept. 6th, 2006)
+===============================
* Added sub_domains option to mapper, along with sub_domains_ignore list for
subdomains that are considered equivilant to the main domain. When sub_domains
is active, url_for will now take a sub_domain option that can alter the host
@@ -224,7 +245,8 @@ Routes Changelog
* Patch applied from Ticket #28. Resolves issue with Mapper's controller_scan
function requiring a valid directory argument. Submitted by Zoran Isailovski.
--- 1.4 (July 21, 2006)
+Release 1.4 (July 21, 2006)
+===========================
* Fixed bug with map.resource related to member methods, found in Rails version.
* Fixed bug with map.resource member methods not requiring a member id.
* Fixed bug related to handling keyword argument controller.
@@ -239,11 +261,13 @@ Routes Changelog
* Fixed redirect_to function for using absolute URL's. redirect_to now passes all args to
url_for, then passes the resulting URL to the redirect function. Reported by climbus.
--- 1.3.2 (April 30th, 2006)
+Release 1.3.2 (April 30th, 2006)
+================================
* Fixed _filter bug with inclusion in match dict during matching, reported by David Creemer.
* Fixed improper url quoting by using urllib.encode, patch by Jason Culverhouse.
--- 1.3.1 (April 4th, 2006)
+Release 1.3.1 (April 4th, 2006)
+===============================
* Mapper has an optional attribute ``append_slash``. When set to ``True``, any URL's
generated will have a slash appended to the end.
* Fixed prefix option so that if the PATH_INFO is empty after prefix regexp, its set to
@@ -251,16 +275,18 @@ Routes Changelog
* Fixed prefix bug that caused routes after the initial one to not see the proper url
for matching. Caught by Jochen Kupperschmidt.
--- 1.3 (Feb. 25th, 2006)
+Release 1.3 (Feb. 25th, 2006)
+=============================
* url_for keyword filters:
- - Named routes can now have a _filter argument that should specify a function that takes
- a dict as its sole argument. The dict will contain the full set of keywords passed to
- url_for, which the function can then modify as it pleases. The new dict will then be
- used as if it was the original set of keyword args given to url_for.
+ Named routes can now have a _filter argument that should specify a function that takes
+ a dict as its sole argument. The dict will contain the full set of keywords passed to
+ url_for, which the function can then modify as it pleases. The new dict will then be
+ used as if it was the original set of keyword args given to url_for.
* Fixed Python 2.3 incompatibility due to using keyword arg for a sort statement
when using the built-in controller scanner.
--- 1.2 (Feb. 17th, 2006)
+Release 1.2 (Feb. 17th, 2006)
+=============================
* If a named route doesn't exist, and a url_for call is used, instead of using the
keyword arguments to generate a URL, they will be used as query args for the raw
URL supplied. (Backwards Incompatible)
@@ -268,58 +294,72 @@ Routes Changelog
that matched, if one did match. And a list of routes that were tried, and information
about why they didn't pass.
* url_for enhancements:
- - Can now be used with 'raw' URL's to generate proper url's for static content that
- will then automatically include SCRIPT_NAME if necessary
- - Static named routes can now be used to shortcut common path information as desired.
+ Can now be used with 'raw' URL's to generate proper url's for static content that
+ will then automatically include SCRIPT_NAME if necessary
+ Static named routes can now be used to shortcut common path information as desired.
* Controller Scanner will now sort controller names so that the longest one is first. This
ensures that the deepest nested controller is executed first before more shallow ones to
increase predictability.
* Controller Scanner now scans directories properly, the version in 1.1 left off the
directory prefix when created the list of controllers.
- (Thanks to Justin for drawing my attention to it)
+ (Thanks to Justin for drawing my attention to it)
--- 1.1 (Jan. 13th, 2006)
+Release 1.1 (Jan. 13th, 2006)
+=============================
* Routes Mapper additions:
- - Now takes several optional arguments that determine how it will
- generate the regexp's.
- - Can now hold a function for use when determining what the available
- controllers are. Comes with a default directory scanner
- - Given a directory for the default scanner or a function, the Mapper
- will now automatically run it to get the controller list when needed
+ Now takes several optional arguments that determine how it will
+ generate the regexp's.
+ Can now hold a function for use when determining what the available
+ controllers are. Comes with a default directory scanner
+ Given a directory for the default scanner or a function, the Mapper
+ will now automatically run it to get the controller list when needed
* Syntax available for splitting routes to allow more complex route paths, such
as ':controller/:(action)-:(id).html'
* Easier setup/integration with Routes per request. Setting the environ in a
WSGI environ will run match, and setup everything needed for url_for/etc.
--- 1.0.2 (Dec. 30th, 2005)
+Release 1.0.2 (Dec. 30th, 2005)
+===============================
* Routes where a default was present but None were filling in improper values.
* Passing a 0 would evaluate to None during generation, resulting in missing
URL parts
--- 1.0.1 (Dec. 18th, 2005)
+Release 1.0.1 (Dec. 18th, 2005)
+===============================
* Request Local Callable - You can now designate your own callable function that
should then be used to store the request_config data. This is most useful for
environments where its possible multiple requests might be running in a single
thread. The callable should return a request specific object for attributes to
be attached. See routes.__init__.py for more information.
--- 1.0 (Nov. 21st, 2005)
+Release 1.0 (Nov. 21st, 2005)
+=============================
* routes.__init__ will now load the common symbols most people will
want to actually use.
- Thus, you can either:
+ Thus, you can either::
+
from routes import *
- Or:
+
+ Or::
+
from routes import request_confg, Mapper
- The following names are available for importing from routes:
+
+ The following names are available for importing from routes::
+
request_config, Mapper, url_for, redirect_to
+
* Route Names - You can now name a route, which will save a copy of the defaults
defined for later use by url_for or redirect_to.
- Thus, a route and url_for looking like this:
+ Thus, a route and url_for looking like this::
+
m.connect('home', controller='blog', action='splash')
url_for(controller='blog', action='splash') # => /home
- Can now be used with a name:
+
+ Can now be used with a name::
+
m.connect('home_url','home', controller='blog', action='splash')
url_for('home_url') # => /home
+
Additional keywords can still be added to url_for and will override defaults in
the named route.
* Trailing / - Route recognition earlier failed on trailing slashes, not really a bug,
diff --git a/docs/_templates/index.html b/docs/_templates/index.html
new file mode 100644
index 0000000..b3f301b
--- /dev/null
+++ b/docs/_templates/index.html
@@ -0,0 +1,74 @@
+{% extends "layout.html" %}
+{% set title = 'Overview' %}
+{% block body %}
+ <p>Routes is a Python re-implementation of the Rails routes system for mapping URLs to Controllers/Actions and generating URLs. Routes makes it easy to
+create pretty and concise URLs that are RESTful with little effort.</p>
+ <p>Speedy and dynamic URL generation means that you get a URL with minimal cruft (no big dangling query args). Shortcut features like Named Routes cut down on
+repetitive typing.</p>
+
+ <p>Current features:</p>
+
+ <ul>
+ <li><strong>Named Routes</strong></li>
+ <li><strong>Sophisticated Route lookup</strong> and URL generation</strong></li>
+ <li><strong>Wildcard paths</strong> before and after static parts</strong></li>
+ <li><strong>Groupings syntax</strong> to allow flexible URLs to accommodate almost any need</li>
+ <li><strong>Sub-domain support</strong> is built-in</li>
+ <li><strong>Conditional matching</strong> based on domain, cookies, HTTP method (RESTful) and more</li>
+ <li><strong>Easily extensible</strong> using custom condition functions and route generation functions</li>
+ <li><strong>Extensive unit tests</strong></li>
+ </ul>
+
+ <p>Buzzword Compliance: <em>REST</em>, <em>DRY</em>
+
+
+ <h2>News</h2>
+ <p><strong>6/13/2008</strong>: Routes 1.9 released, another step on the Road to Routes 2.0. Some of the highlights that people will probably find the most interesting:</p>
+
+ <h4>Minmization is optional</h4>
+ <p>Pylons 0.9.7 will default to turning minimization off (projects are free to leave it on if desired). This means that constructing a route like this with minimization off:</p>
+
+ <p><tt>map.connect('/:controller/:action/')</tt></p>
+
+ <p>will actually require both the controller and the action to be present, and the trailing slash. This addresses the trailing slash issue I wanted to fix as well.</p>
+ <h4>Named Routes will always use the route named</h4>
+ <p>This is now on by default in Routes 1.9, which results in faster url_for calls as well as the predictability that comes with knowing exactly which route will be used.</p>
+
+ <h4>Optional non-Rails’ish syntax</h4>
+ <p>You can now specify route paths in the same syntax that Routes 2 will be using:</p>
+
+ <p><tt>map.connect('/{controller}/{action}/{id}')</tt></p>
+
+ <p>Or if you wanted to include the requirement that the id should be 2 digits:</p>
+ <p><tt>map.connect('/{controller}/{action}/{id:\d\d}')</tt></p>
+ <p>Routes automatically builds the appropriate regular expression for you, keeping your routes a lot
+easier to skim over than a bunch of regular expressions.</p>
+ <p>Routes 2 will be bringing redirect routes, and generation-only routes, making Routes 1.9 a great way to transition to Routes 2 when its ready.</p>
+
+
+ <h2>Documentation</h2>
+ <table class="contentstable" align="center" style="margin-left: 30px"><tr>
+ <td width="50%">
+ <p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Contents</a><br/>
+ <span class="linkdescr">for a complete overview</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("search") }}">Search page</a><br/>
+ <span class="linkdescr">search the documentation</span></p>
+ </td><td width="50%">
+ <p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">General Index</a><br/>
+ <span class="linkdescr">all functions, classes, terms</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("modindex") }}">Module Index</a><br/>
+ <span class="linkdescr">quick access to all documented modules</span></p>
+ </td></tr>
+ </table>
+
+ <p>Download <a href="http://routes.groovie.org/routes.pdf">Routes PDF documentation</a>.</p>
+
+ <h2>Source</h2>
+ <p>Route's Mercurial repository can be found at
+ <a href="http://bitbucket.org/bbangert/routes/"><tt>http://bitbucket.org/bbangert/routes/</tt></a>.</p>
+
+ <p>To check out:</p>
+
+ <pre>hg clone http://www.bitbucket.org/bbangert/routes</pre>
+
+{% endblock %} \ No newline at end of file
diff --git a/docs/_templates/indexsidebar.html b/docs/_templates/indexsidebar.html
new file mode 100644
index 0000000..94a81c8
--- /dev/null
+++ b/docs/_templates/indexsidebar.html
@@ -0,0 +1,19 @@
+<h3>Download</h3>
+{% if version.endswith('(hg)') %}
+<p>This documentation is for version <b>{{ version }}</b>, which is
+ not released yet.</p>
+<p>You can use it from the
+ <a href="http://bitbucket.org/bbangert/routes/">Mercurial repo</a> or look for
+ released versions in the <a href="http://pypi.python.org/pypi/Routes">Python
+ Package Index</a>.</p>
+{% else %}
+<p>Current version: <b>{{ version }}</b></p>
+<p>Get Routes from the <a href="http://pypi.python.org/pypi/Routes">Python Package
+Index</a>, or install it with:</p>
+<pre>easy_install -U Routes</pre>
+{% endif %}
+
+<h3>Bugs? Suggestions?</h3>
+
+<p>Report them at the Bitbucket
+ <a href="http://www.bitbucket.org/bbangert/routes/issues/">tracker</a>.</p>
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
new file mode 100644
index 0000000..2b0e9e2
--- /dev/null
+++ b/docs/_templates/layout.html
@@ -0,0 +1,11 @@
+{% extends "!layout.html" %}
+
+{% block rootrellink %}
+ <li><a href="{{ pathto('index') }}">Routes home</a>&nbsp;|&nbsp;</li>
+ <li><a href="{{ pathto('contents') }}">Documentation</a>&raquo;</li>
+{% endblock %}
+
+{% block header %}
+<div style="color: #D1361B; font-size: 70px; font-weight: bold; padding: 10px 0 0 10px;">Routes</div>
+</div>
+{% endblock %} \ No newline at end of file
diff --git a/docs/changes.rst b/docs/changes.rst
new file mode 100644
index 0000000..d7fa398
--- /dev/null
+++ b/docs/changes.rst
@@ -0,0 +1,8 @@
+:tocdepth: 2
+
+.. _changes:
+
+Changes in Routes
+*****************
+
+.. include:: ../CHANGELOG
diff --git a/docs/community/index.txt b/docs/community/index.txt
deleted file mode 100644
index 88e6014..0000000
--- a/docs/community/index.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Community
-=========
-
-Mailing List
-------------
-
-Currently any questions, suggestions, and patches can be directed at the `Pylons-discuss mailing list <http://groups.google.com/group/pylons-discuss>`_.
-
-Online Chat
------------
-
-You can get live (on occasion) assistance with Routes in the #pylons channel on irc.freenode.net. \ No newline at end of file
diff --git a/docs/conf.py b/docs/conf.py
index f5f6446..045fe87 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -11,17 +11,19 @@
# All configuration values have a default value; values that are commented out
# serve to show the default value.
-import sys
+import sys, os
-# If your extensions are in another directory, add it here.
-#sys.path.append('some/directory')
+# If your extensions are in another directory, add it here. If the directory
+# is relative to the documentation root, use os.path.abspath to make it
+# absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-#extensions = []
+extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -30,7 +32,7 @@ templates_path = ['_templates']
source_suffix = '.rst'
# The master toctree document.
-master_doc = 'index'
+master_doc = 'contents'
# General substitutions.
project = 'Routes'
@@ -83,28 +85,59 @@ html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
-html_last_updated_fmt = '%b %d, %Y'
+#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
-# Content template for the index page.
-#html_index = ''
+html_index = 'index.html'
# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
+html_sidebars = {'index': 'indexsidebar.html'}
# Additional templates that should be rendered to pages, maps page names to
# template names.
-#html_additional_pages = {}
+html_additional_pages = {'index': 'index.html'}
+
+html_theme_options = {
+ "bgcolor": "#fff",
+ "footertextcolor": "#666",
+ "relbarbgcolor": "#fff",
+ "relbarlinkcolor": "#590915",
+ "relbartextcolor": "#FFAA2D",
+ "sidebarlinkcolor": "#590915",
+ "sidebarbgcolor": "#fff",
+ "sidebartextcolor": "#333",
+ "footerbgcolor": "#fff",
+ "linkcolor": "#590915",
+ "bodyfont": "helvetica, 'bitstream vera sans', sans-serif",
+ "headfont": "georgia, 'bitstream vera sans serif', 'lucida grande', helvetica, verdana, sans-serif",
+ "headbgcolor": "#fff",
+ "headtextcolor": "#12347A",
+ "codebgcolor": "#fff",
+}
# If false, no module index is generated.
#html_use_modindex = True
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
# If true, the reST sources are included in the HTML build as _sources/<name>.
#html_copy_source = True
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+html_use_opensearch = 'http://routes.groovie.org/'
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
# Output file base name for HTML help builder.
htmlhelp_basename = 'Routesdoc'
@@ -120,13 +153,34 @@ htmlhelp_basename = 'Routesdoc'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
-#latex_documents = []
+latex_documents = [
+ ('contents', 'Routes.tex', u'Routes Documentation',
+ u'Ben Bangert', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
+latex_preamble = '''
+\usepackage{palatino}
+\definecolor{TitleColor}{rgb}{0.7,0,0}
+\definecolor{InnerLinkColor}{rgb}{0.7,0,0}
+\definecolor{OuterLinkColor}{rgb}{0.8,0,0}
+\definecolor{VerbatimColor}{rgb}{0.985,0.985,0.985}
+\definecolor{VerbatimBorderColor}{rgb}{0.8,0.8,0.8}
+'''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
-#latex_use_modindex = True
+latex_use_modindex = False
+
+# Added to handle docs in middleware.py
+autoclass_content = "both"
diff --git a/docs/contents.rst b/docs/contents.rst
new file mode 100644
index 0000000..a98c5b0
--- /dev/null
+++ b/docs/contents.rst
@@ -0,0 +1,31 @@
+Routes Documentation
+====================
+
+.. toctree::
+ :maxdepth: 2
+
+ manual
+
+.. toctree::
+ :maxdepth: 1
+
+ changes
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+* :ref:`glossary`
+
+Module Listing
+--------------
+
+.. toctree::
+ :maxdepth: 2
+
+ modules
+
+
diff --git a/docs/docs/index.txt b/docs/docs/index.txt
deleted file mode 100644
index 077c9a1..0000000
--- a/docs/docs/index.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Documentation
-+++++++++++++
-
-For users:
-
-* `Routes Manual <../manual.html>`_
-* `Route Recipes - Common Tasks in Routes <../recipes.html>`_
-
-For Python web framework creators:
-
-* `Integrating Routes with your Python web framework <../integration.html>`_
diff --git a/docs/download/index.txt b/docs/download/index.txt
deleted file mode 100644
index c028e14..0000000
--- a/docs/download/index.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Download
-========
-
-Latest Release
---------------
-
-**Release 1.3.2** : Apr. 30th, 2006
-
-If you already have Easy Install::
- sudo easy_install Routes
-
-If you don't have it yet, download `ez_setup.py </files/ez_setup.py>`_ then::
- sudo python ez_setup.py Routes
-
-
-Development Version
--------------------
-
-You can checkout the latest Routes code from the svn repository with::
-
- svn co http://routes.groovie.org/svn/trunk routes \ No newline at end of file
diff --git a/docs/glossary.rst b/docs/glossary.rst
new file mode 100644
index 0000000..822436a
--- /dev/null
+++ b/docs/glossary.rst
@@ -0,0 +1,7 @@
+.. _glossary:
+
+Glossary
+========
+
+.. glossary::
+
diff --git a/docs/index.rst b/docs/index.rst
index ad7b722..81a1aee 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,17 +1,292 @@
-Routes Reference
-================
+Routes
+++++++
-Contents:
+Routes is a Python re-implementation of the `Rails routes system <http://manuals.rubyonrails.com/read/book/9>`_
+for mapping URL's to Controllers/Actions and generating URL's. Routes makes it easy to create pretty and concise URL's that are RESTful with little effort.
-.. toctree::
- :maxdepth: 2
+Speedy and dynamic URL generation means you get a URL with minimal cruft (no big dangling query args). Shortcut features like Named Routes cut down on repetitive typing.
- manual
+Current features:
-Indices and tables
-==================
+* Named Routes
+* Sophisticated Route lookup and URL generation
+* Wildcard path's before and after static parts
+* Groupings syntax to allow flexible URL's to accommodate almost any need
+* Sub-domain support built-in
+* Conditional matching based on domain, cookies, HTTP method (RESTful), and more
+* Easily extensible utilizing custom condition functions and route generation functions
+* Extensive unit tests
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
+Buzzword Compliance: *REST*, *DRY*
+News
+====
+
+**Feb. 26th, 2008**
+
+Routes 1.7.2:
+
+* Fixed bug with keyword args not being coerced to raw string properly.
+
+
+**Nov. 16th, 2007**
+
+Routes 1.7.1:
+
+* Fixed bug with sub-domains from route defaults getting encoded to unicode
+ resulting in a unicode route which then caused url_for to throw an
+ exception.
+* Removed duplicate assignment in map.resource. Patch by Mike Naberezny.
+* Applied test patch fix for path checking. Thanks Mike Naberezny.
+* Added additional checking of remaining URL, to properly swallow periods in
+ the appropriate context. Fixes #57.
+* Added mapper.hardcode_names option which restricts url generation to the
+ named route during generation rather than using the routes default options
+ during generation.
+* Fixed the special '_method' attribute not being recognized during POST
+ requests of Content-Type 'multipart/form-data'.
+
+
+**June 8th, 2007**
+
+Routes 1.7:
+
+* Fixed url_unquoting to only apply for strings.
+* Added _encoding option to individual routes to toggle decoding/encoding on a
+ per route basis.
+* Fixed route matching so that '.' and other special chars are only part of the
+ match should they not be followed by that character. Fixed regexp creation so
+ that route parts with '.' in them aren't matched properly. Fixes #48.
+* Fixed Unicode decoding/encoding so that the URL decoding and encoding can be
+ set on the mapper with mapper.encoding. Fixes #40.
+* Don't assume environ['CONTENT_TYPE'] always exists: it may be ommitted
+ according to the WSGI PEP.
+* Fixed Unicode decode/encoding of path_info dynamic/wildcard parts so that
+ PATH_INFO will stay a raw string as it should. Fixes #51.
+* Fixed url_for (thus redirect_to) to throw an exception if a Unicode
+ string is returned as that's an invalid URL. Fixes #46.
+* Fixed Routes middleware to only parse POST's if the content type is
+ application/x-www-form-urlencoded for a HTML form. This properly avoids
+ parsing wsgi.input when it doesn't need to be.
+
+
+**April 10th, 2007**
+
+Routes 1.6.3:
+
+* Fixed matching so that an attempt to match an empty path raises a
+ RouteException. Fixes #44.
+* Added ability to use characters in URL's such as '-' and '_' in
+ map.resource. Patch by Wyatt Baldwin. Fixes #45.
+* Updated Mapper.resource handling with name_prefix and path_prefix checking
+ to specify defaults. Also ensures that should either of them be set, they
+ override the prefixes should parent_resource be specified. Patch by Wyatt
+ Baldwin. Fixes #42.
+* Added utf-8 decoding of incoming path arguments, with fallback to ignoring
+ them in the very rare cases a malformed request URL is sent. Patch from
+ David Smith.
+* Fixed treatment of '#' character as something that can be left off and
+ used in route paths. Found by Mike Orr.
+* Added ability to specify parent resource to map.resource command. Patch from
+ Wyatt Baldwin.
+* Fixed formatted route issue with map.resource when additional collection
+ methods are specified. Added unit tests to verify the collection methods
+ work properly.
+* Updated URL parsing to properly use HTTP_HOST for hostname + port info before
+ falling back to SERVER_PORT and SERVER_NAME. Fixes #43.
+* Added member_name and collection_name setting to Route object when made with
+ map.resource.
+* Updated routes.middleware to make the Routes matched accessible as
+ environ['routes.route'].
+* Updating mapper object to use thread local for request data (such as
+ environ) and middleware now deletes environ references at the end of the
+ request.
+* Added explicit option to Routes and Mapper. Routes _explicit setting will
+ prevent the Route defaults from being implicitly set, while setting Mapper
+ to explicit will prevent Route implicit defaults and stop url_for from using
+ Route memory. Fixes #38.
+* Updated config object so that the route is attached if possible.
+* Adding standard logging usage with debug messages.
+* Added additional test for normal '.' match and fixed new special matching to
+ match it properly. Thanks David Smith.
+* Fixed hanging special char issue with 'special' URL chars at the end of a URL
+ that are missing the variable afterwards.
+* Changed Routes generation and recognition to handle other 'special' URL chars
+ , . and ; as if they were /. This lets them be optionally left out of the
+ resulting generated URL. Feature requested by David Smith.
+* Fixed lookahead assertion in regexp builder to properly handle two grouped
+ patterns in a row.
+* Applied patch to generation and matching to handle Unicode characters
+ properly. Reported with patch by David Smith.
+
+
+**Jan. 5, 2007**
+
+Routes 1.6.2:
+
+* Fixed issue with method checking not properly handling different letter
+ cases in REQUEST_METHOD. Reported by Sean Davis.
+* redirect_to now supports config.redirect returning a redirect, not just
+ raising one.
+
+
+**Dec. 29, 2006**
+
+Routes 1.6.1:
+
+* Fixed zipsafe flag to be False as it occasionally was installed zipped.
+
+
+**Dec. 14th, 2006**
+
+Routes 1.6:
+
+* Fixed append_slash to take effect in the route generation itself instead of
+ relying on url_for function. Reported by ToddG.
+* Added additional url_for tests to ensure map.resource generates proper named
+ routes.
+* WARNING: Changed map.resource initialization to accept individual member and
+ collection names to generate proper singular and plural route names. Those
+ using map.resource will need to update their routes and url_for statements
+ accordingly.
+* Added additional map.resource recognition tests.
+* Added WSGI middleware that does route resolving using new `WSGI.org Routing
+ Vars Spec <http://wsgi.org/wsgi/Specifications/routing_args>`_.
+* Added _absolute keyword option route connect to ignore SCRIPT_NAME settings.
+ Suggested by Ian Bicking.
+
+
+**Oct. 16th, 2006**
+
+Routes 1.5.2:
+
+* Fixed qualified keyword to keep host port names when used, unless a host
+ is specifically passed in. Reported by Jon Rosebaugh.
+* Added fully_qualified keyword option to url_for to have it generate a full
+ URL. Resolves #29.
+* Fixed examples in url_for doc strings so they'll be accurate.
+
+
+**Oct. 4th, 2006**
+
+Routes 1.5.1:
+
+* Fixed bug with escaping part names in the regular expression, reported by
+ James Taylor.
+
+
+**Sept. 19th, 2006**
+
+Routes 1.5 released:
+
+* Significant updates to map.resource and unit tests that comb it thoroughly
+ to ensure its creating all the proper routes (it now is). Increased unit
+ testing coverage to 95%.
+* Added unit tests to ensure controller_scan works properly with nested
+ controller files and appropriately scans the directory structure. This
+ brings the Routes util module up to full code coverage.
+* Fixed url_for so that when the protocol is changed, port information is
+ removed from the host.
+* Added more thorough testing to _RequestConfig object and the ability to
+ set your own object. This increases testing coverage of the __init__ module
+ to 100%.
+* Fixed bug with sub_domain not maintaining port information in url_for and
+ added unit tests. Reported by Jonathan Rosebaugh.
+* Added unit tests to ensure sub_domain option works with named routes, cleaned
+ up url_for memory argument filtering. Fixed bug with named routes and sub_domain
+ option not working together, reported by Jonathan Rosebaugh.
+* Changed order in which sub-domain is added to match-dict so it can be used
+ in a conditions function.
+
+
+**Sept. 6th, 2006**
+
+Routes 1.4.1 released:
+
+* Added sub_domains option to mapper, along with sub_domains_ignore list for
+ subdomains that are considered equivalent to the main domain. When sub_domains
+ is active, url_for will now take a sub_domain option that can alter the host
+ the route will go to.
+* Added ability for filter functions to provide a _host, _protocol, _anchor arg
+ which is then used to create the URL with the appropriate host/protocol/anchor
+ destination.
+* Patch applied from Ticket #28. Resolves issue with Mapper's controller_scan
+ function requiring a valid directory argument. Submitted by Zoran Isailovski.
+
+**July 21, 2006**
+
+Routes 1.4 released:
+
+* Fixed bug with map.resource related to member methods, found in Rails version.
+* Fixed bug with map.resource member methods not requiring a member id.
+* Fixed bug related to handling keyword argument controller.
+* Added map.resource command which can automatically generate a batch of routes intended
+ to be used in a REST-ful manner by a web framework.
+* Added URL generation handling for a 'method' argument. If 'method' is specified, it
+ is not dropped and will be changed to '_method' for use by the framework.
+* Added conditions option to map.connect. Accepts a dict with optional keyword args
+ 'method' or 'function'. Method is a list of HTTP methods that are valid for the route.
+ Function is a function that will be called with environ and matchdict where matchdict is
+ the dict created by the URL match.
+* Fixed redirect_to function for using absolute URL's. redirect_to now passes all args to
+ url_for, then passes the resulting URL to the redirect function. Reported by climbus.
+
+
+
+**April 30th, 2006**
+
+Routes 1.3.2 released with:
+
+* Fixed _filter bug with inclusion in match dict during matching, reported by David Creemer.
+* Fixed improper url quoting by using urllib.encode, patch by Jason Culverhouse.
+
+
+
+**April 4th, 2006**
+
+Routes 1.3.1 released with:
+
+* Mapper has an optional attribute ``append_slash``. When set to ``True``, any URL's
+ generated will have a slash appended to the end.
+* Fixed prefix option so that if the PATH_INFO is empty after prefix regexp, its set to
+ '/' so the match proceeds ok.
+* Fixed prefix bug that caused routes after the initial one to not see the proper url
+ for matching. Caught by Jochen Kupperschmidt.
+
+
+
+**February 25th, 2006**
+
+Routes 1.3 released with:
+
+* Filter functionality when using named routes
+* Fixed Python 2.3 incompatibility issue with 1.2
+
+
+**February 17th, 2006**
+
+Routes 1.2 released with:
+
+* Mapper debugging capabilities
+* URL generation enhancements for application portability
+* Static named routes
+
+
+**January 13th, 2006**
+
+Routes 1.1 released with:
+
+* Easier integration
+* Powerful Groupings syntax for more flexibility
+
+Credits
+=======
+
+Many thanks to `Nicholas Seckar <http://wiki.rubyonrails.com/rails/show/NicholasSeckar>`_ for his insight and explanation of many aspects of the Rails Route system.
+
+Author
+======
+
+`Ben Bangert <http://www.groovie.org/>`_ (`e-mail <mailto:ben@groovie.org>`_)
+
+Development sponsored by `Parachute LLC. <http://www.parachute.com/>`_
diff --git a/docs/index.txt b/docs/index.txt
deleted file mode 100644
index 81a1aee..0000000
--- a/docs/index.txt
+++ /dev/null
@@ -1,292 +0,0 @@
-Routes
-++++++
-
-Routes is a Python re-implementation of the `Rails routes system <http://manuals.rubyonrails.com/read/book/9>`_
-for mapping URL's to Controllers/Actions and generating URL's. Routes makes it easy to create pretty and concise URL's that are RESTful with little effort.
-
-Speedy and dynamic URL generation means you get a URL with minimal cruft (no big dangling query args). Shortcut features like Named Routes cut down on repetitive typing.
-
-Current features:
-
-* Named Routes
-* Sophisticated Route lookup and URL generation
-* Wildcard path's before and after static parts
-* Groupings syntax to allow flexible URL's to accommodate almost any need
-* Sub-domain support built-in
-* Conditional matching based on domain, cookies, HTTP method (RESTful), and more
-* Easily extensible utilizing custom condition functions and route generation functions
-* Extensive unit tests
-
-Buzzword Compliance: *REST*, *DRY*
-
-News
-====
-
-**Feb. 26th, 2008**
-
-Routes 1.7.2:
-
-* Fixed bug with keyword args not being coerced to raw string properly.
-
-
-**Nov. 16th, 2007**
-
-Routes 1.7.1:
-
-* Fixed bug with sub-domains from route defaults getting encoded to unicode
- resulting in a unicode route which then caused url_for to throw an
- exception.
-* Removed duplicate assignment in map.resource. Patch by Mike Naberezny.
-* Applied test patch fix for path checking. Thanks Mike Naberezny.
-* Added additional checking of remaining URL, to properly swallow periods in
- the appropriate context. Fixes #57.
-* Added mapper.hardcode_names option which restricts url generation to the
- named route during generation rather than using the routes default options
- during generation.
-* Fixed the special '_method' attribute not being recognized during POST
- requests of Content-Type 'multipart/form-data'.
-
-
-**June 8th, 2007**
-
-Routes 1.7:
-
-* Fixed url_unquoting to only apply for strings.
-* Added _encoding option to individual routes to toggle decoding/encoding on a
- per route basis.
-* Fixed route matching so that '.' and other special chars are only part of the
- match should they not be followed by that character. Fixed regexp creation so
- that route parts with '.' in them aren't matched properly. Fixes #48.
-* Fixed Unicode decoding/encoding so that the URL decoding and encoding can be
- set on the mapper with mapper.encoding. Fixes #40.
-* Don't assume environ['CONTENT_TYPE'] always exists: it may be ommitted
- according to the WSGI PEP.
-* Fixed Unicode decode/encoding of path_info dynamic/wildcard parts so that
- PATH_INFO will stay a raw string as it should. Fixes #51.
-* Fixed url_for (thus redirect_to) to throw an exception if a Unicode
- string is returned as that's an invalid URL. Fixes #46.
-* Fixed Routes middleware to only parse POST's if the content type is
- application/x-www-form-urlencoded for a HTML form. This properly avoids
- parsing wsgi.input when it doesn't need to be.
-
-
-**April 10th, 2007**
-
-Routes 1.6.3:
-
-* Fixed matching so that an attempt to match an empty path raises a
- RouteException. Fixes #44.
-* Added ability to use characters in URL's such as '-' and '_' in
- map.resource. Patch by Wyatt Baldwin. Fixes #45.
-* Updated Mapper.resource handling with name_prefix and path_prefix checking
- to specify defaults. Also ensures that should either of them be set, they
- override the prefixes should parent_resource be specified. Patch by Wyatt
- Baldwin. Fixes #42.
-* Added utf-8 decoding of incoming path arguments, with fallback to ignoring
- them in the very rare cases a malformed request URL is sent. Patch from
- David Smith.
-* Fixed treatment of '#' character as something that can be left off and
- used in route paths. Found by Mike Orr.
-* Added ability to specify parent resource to map.resource command. Patch from
- Wyatt Baldwin.
-* Fixed formatted route issue with map.resource when additional collection
- methods are specified. Added unit tests to verify the collection methods
- work properly.
-* Updated URL parsing to properly use HTTP_HOST for hostname + port info before
- falling back to SERVER_PORT and SERVER_NAME. Fixes #43.
-* Added member_name and collection_name setting to Route object when made with
- map.resource.
-* Updated routes.middleware to make the Routes matched accessible as
- environ['routes.route'].
-* Updating mapper object to use thread local for request data (such as
- environ) and middleware now deletes environ references at the end of the
- request.
-* Added explicit option to Routes and Mapper. Routes _explicit setting will
- prevent the Route defaults from being implicitly set, while setting Mapper
- to explicit will prevent Route implicit defaults and stop url_for from using
- Route memory. Fixes #38.
-* Updated config object so that the route is attached if possible.
-* Adding standard logging usage with debug messages.
-* Added additional test for normal '.' match and fixed new special matching to
- match it properly. Thanks David Smith.
-* Fixed hanging special char issue with 'special' URL chars at the end of a URL
- that are missing the variable afterwards.
-* Changed Routes generation and recognition to handle other 'special' URL chars
- , . and ; as if they were /. This lets them be optionally left out of the
- resulting generated URL. Feature requested by David Smith.
-* Fixed lookahead assertion in regexp builder to properly handle two grouped
- patterns in a row.
-* Applied patch to generation and matching to handle Unicode characters
- properly. Reported with patch by David Smith.
-
-
-**Jan. 5, 2007**
-
-Routes 1.6.2:
-
-* Fixed issue with method checking not properly handling different letter
- cases in REQUEST_METHOD. Reported by Sean Davis.
-* redirect_to now supports config.redirect returning a redirect, not just
- raising one.
-
-
-**Dec. 29, 2006**
-
-Routes 1.6.1:
-
-* Fixed zipsafe flag to be False as it occasionally was installed zipped.
-
-
-**Dec. 14th, 2006**
-
-Routes 1.6:
-
-* Fixed append_slash to take effect in the route generation itself instead of
- relying on url_for function. Reported by ToddG.
-* Added additional url_for tests to ensure map.resource generates proper named
- routes.
-* WARNING: Changed map.resource initialization to accept individual member and
- collection names to generate proper singular and plural route names. Those
- using map.resource will need to update their routes and url_for statements
- accordingly.
-* Added additional map.resource recognition tests.
-* Added WSGI middleware that does route resolving using new `WSGI.org Routing
- Vars Spec <http://wsgi.org/wsgi/Specifications/routing_args>`_.
-* Added _absolute keyword option route connect to ignore SCRIPT_NAME settings.
- Suggested by Ian Bicking.
-
-
-**Oct. 16th, 2006**
-
-Routes 1.5.2:
-
-* Fixed qualified keyword to keep host port names when used, unless a host
- is specifically passed in. Reported by Jon Rosebaugh.
-* Added fully_qualified keyword option to url_for to have it generate a full
- URL. Resolves #29.
-* Fixed examples in url_for doc strings so they'll be accurate.
-
-
-**Oct. 4th, 2006**
-
-Routes 1.5.1:
-
-* Fixed bug with escaping part names in the regular expression, reported by
- James Taylor.
-
-
-**Sept. 19th, 2006**
-
-Routes 1.5 released:
-
-* Significant updates to map.resource and unit tests that comb it thoroughly
- to ensure its creating all the proper routes (it now is). Increased unit
- testing coverage to 95%.
-* Added unit tests to ensure controller_scan works properly with nested
- controller files and appropriately scans the directory structure. This
- brings the Routes util module up to full code coverage.
-* Fixed url_for so that when the protocol is changed, port information is
- removed from the host.
-* Added more thorough testing to _RequestConfig object and the ability to
- set your own object. This increases testing coverage of the __init__ module
- to 100%.
-* Fixed bug with sub_domain not maintaining port information in url_for and
- added unit tests. Reported by Jonathan Rosebaugh.
-* Added unit tests to ensure sub_domain option works with named routes, cleaned
- up url_for memory argument filtering. Fixed bug with named routes and sub_domain
- option not working together, reported by Jonathan Rosebaugh.
-* Changed order in which sub-domain is added to match-dict so it can be used
- in a conditions function.
-
-
-**Sept. 6th, 2006**
-
-Routes 1.4.1 released:
-
-* Added sub_domains option to mapper, along with sub_domains_ignore list for
- subdomains that are considered equivalent to the main domain. When sub_domains
- is active, url_for will now take a sub_domain option that can alter the host
- the route will go to.
-* Added ability for filter functions to provide a _host, _protocol, _anchor arg
- which is then used to create the URL with the appropriate host/protocol/anchor
- destination.
-* Patch applied from Ticket #28. Resolves issue with Mapper's controller_scan
- function requiring a valid directory argument. Submitted by Zoran Isailovski.
-
-**July 21, 2006**
-
-Routes 1.4 released:
-
-* Fixed bug with map.resource related to member methods, found in Rails version.
-* Fixed bug with map.resource member methods not requiring a member id.
-* Fixed bug related to handling keyword argument controller.
-* Added map.resource command which can automatically generate a batch of routes intended
- to be used in a REST-ful manner by a web framework.
-* Added URL generation handling for a 'method' argument. If 'method' is specified, it
- is not dropped and will be changed to '_method' for use by the framework.
-* Added conditions option to map.connect. Accepts a dict with optional keyword args
- 'method' or 'function'. Method is a list of HTTP methods that are valid for the route.
- Function is a function that will be called with environ and matchdict where matchdict is
- the dict created by the URL match.
-* Fixed redirect_to function for using absolute URL's. redirect_to now passes all args to
- url_for, then passes the resulting URL to the redirect function. Reported by climbus.
-
-
-
-**April 30th, 2006**
-
-Routes 1.3.2 released with:
-
-* Fixed _filter bug with inclusion in match dict during matching, reported by David Creemer.
-* Fixed improper url quoting by using urllib.encode, patch by Jason Culverhouse.
-
-
-
-**April 4th, 2006**
-
-Routes 1.3.1 released with:
-
-* Mapper has an optional attribute ``append_slash``. When set to ``True``, any URL's
- generated will have a slash appended to the end.
-* Fixed prefix option so that if the PATH_INFO is empty after prefix regexp, its set to
- '/' so the match proceeds ok.
-* Fixed prefix bug that caused routes after the initial one to not see the proper url
- for matching. Caught by Jochen Kupperschmidt.
-
-
-
-**February 25th, 2006**
-
-Routes 1.3 released with:
-
-* Filter functionality when using named routes
-* Fixed Python 2.3 incompatibility issue with 1.2
-
-
-**February 17th, 2006**
-
-Routes 1.2 released with:
-
-* Mapper debugging capabilities
-* URL generation enhancements for application portability
-* Static named routes
-
-
-**January 13th, 2006**
-
-Routes 1.1 released with:
-
-* Easier integration
-* Powerful Groupings syntax for more flexibility
-
-Credits
-=======
-
-Many thanks to `Nicholas Seckar <http://wiki.rubyonrails.com/rails/show/NicholasSeckar>`_ for his insight and explanation of many aspects of the Rails Route system.
-
-Author
-======
-
-`Ben Bangert <http://www.groovie.org/>`_ (`e-mail <mailto:ben@groovie.org>`_)
-
-Development sponsored by `Parachute LLC. <http://www.parachute.com/>`_
diff --git a/docs/manual.txt b/docs/manual.txt
deleted file mode 100644
index d3d71b7..0000000
--- a/docs/manual.txt
+++ /dev/null
@@ -1,766 +0,0 @@
-=============
-Routes Manual
-=============
-
-.. contents:: Table of Contents
-.. sectnum::
-
-------------
-Introduction
-------------
-
-Routes tackles an interesting problem that comes up frequently in web
-development, *how do you map a URL to your code?* While there are many
-solutions to this problem, that range from using the URL paths as an object
-publishing hierarchy, to regular expression matching; Routes goes a slightly
-different way.
-
-Using Routes, you specify parts of the URL path and how to match them to your
-**Controllers** and **Actions**. The specific web framework you're using may
-actually call them by slightly different names, but for the sake of consistency
-we will use these names.
-
-Routes lets you have multiple ways to get to the same Controller and Action,
-and uses an intelligent lookup mechanism to try and guarantee you the URL with
-the **least cruft when generating the URL**.
-
-URL Cruft
- Shorthand reference to what will occur if a Route can't handle all the
- arguments we want to send it. Those arguments become HTTP query args
- (/something *?query=arg&another=arg* ), which we try to avoid when
- generating a URL.
-
------------------
-Setting Up Routes
------------------
-
-To setup Routes, it is assumed that you are using a web framework that has the
-Routes mechanism integrated for you. The web framework should have somewhere
-setup for you to add a Route to your Mapper.
-
-Route
- A Route is a mapping of a URL to a controller, action, and/or additional
- variables. Matching a Route will *always* result in a controller and
- action. Route objects are typically created and managed by the Mapper.
-
-Mapper
- The Mapper is the main class used to hold, organize, and match Routes.
- While you can create a Route object independently of the Mapper, its not
- nearly as useful. The Mapper is what you will use to add Routes and what
- the web framework uses to match incoming URLs.
-
-We will also assume for this introduction that your Mapper instance is exposed
-to you as ``m``, for example:
-
-.. code-block:: Python
-
- m = Mapper()
- m.connect(':controller/:action/:id')
-
-The above example covers one of the most common routes that is typically
-considered the *default route*. This very flexible route allows virtually all
-of your controllers and actions to be called. Adding more routes is done in a
-similar manner, by calling ``m.connect(...)`` and giving the Mapper instance a
-set of arguments.
-
-The following are all valid examples of adding routes:
-
-.. code-block:: Python
-
- m.connect('archives/:year/:month/:day', controller='archives',
- action='view', year=2004,
- requirements=dict(year='\d{2,4}', month='\d{1,2}'))
- m.connect('feeds/:category/atom.xml', controller='feeds', action='atom')
- m.connect('history', 'archives/by_eon/:century', controller='archives',
- action='aggregate', century=1800)
- m.connect('article', 'article/:section/:slug/:page.html',
- controller='article', action='view')
- m.connect(':controller/:action/:id')
- m.connect('home', '', controller='blog', action='index')
-
-In the following sections, we'll highlight the section of the Route we're
-referring to in the first example.
-
-Route Name
-----------
-
-*Optional*
-
- ``m.connect(`` 'history' ``, 'archives/by_eon/:century', controller='archives...``
-
-A Route can have a name, this is also referred to as **Named Routes** and lets
-you quickly reference the `Defaults`_ that the route was configured with. This
-is the first non-keyword argument, and if not present the first non-keyword
-argument is assumed to be the `route path`_.
-
-If you don't want to merely load the defaults for a Route, but actually force
-Routes to use **only** the named route for generation, specify the additional
-mapper option as follows:
-
- ``m.hardcode_names = True``
-
-Route Names are mainly used when generating routes, and have no other effect on
-matching a URL.
-
-Static Named Routes
-===================
-
-With the release of 1.2, Routes now supports static named routes. These are
-routes that do not involve actual URL generation, but instead allow you to
-quickly alias common URLs. For example:
-
- ``m.connect('google_search',`` 'http://www.google.com/search', _static=True ``)``
-
-Static Named Routes are ignored entirely when matching a URL.
-
-Filter Functions
-================
-
-Named routes can have functions associated with them that will operate on the
-arguments used during generation. If you have a route that requires multiple
-arguments to generate, like:
-
-.. code-block:: Python
-
- m.connect('archives/:year/:month/:day', controller='archives',
- action='view', year=2004,
- requirements=dict(year='\d{2,4}', month='\d{1,2}'))
-
-To generate a URL for this will require a month and day argument, and a year
-argument if you don't want to use 2004. When using Routes with a database or
-other objects that might have all this information, it's useful to let Routes
-expand that information so you don't have to.
-
-Consider the case where you have a ``story`` object which has a ``year``,
-``month``, and ``day`` attribute. You could generate the URL with:
-
-.. code-block:: Python
-
- url_for(year=story.year, month=story.month, day=story.day)
-
-This isn't terribly convenient, and can be brittle if for some reason you need
-to change the ``story`` objects interface. Here's an example of setting up a
-filter function:
-
-.. code-block:: Python
-
- def story_expand(kargs):
- # Only alter args if a story keyword arg is present
- if 'story' not in kargs:
- return kargs
-
- story = kargs.pop('story')
- kargs['year'] = story.year
- kargs['month'] = story.month
- kargs['day'] = story.day
-
- return kargs
-
- m.connect('archives', 'archives/:year/:month/:day',
- controller='archives', action='view', year=2004,
- requirements=dict(year='\d{2,4}', month='\d{1,2}'),
- _filter=story_expand)
-
-This filter function will be used when using the named route ``archives``. If a
-``story`` keyword argument is present, it will use that and alter the keyword
-arguments used to generate the actual route.
-
-If you have a ``story`` object with those attributes, making the route would
-now be done with the following arguments:
-
-.. code-block:: Python
-
- url_for('archives', story=my_story)
-
-If the story interface changes, you can change how the arguments are pulled out
-in a single location. This also makes it substantially easier to generate the
-URL.
-
-.. warning::
- Using the filter function *requires* the route to be a
- `named route <named routes>`_. This is due to how the filter function can
- affect the route that actually gets chosen. The only way to reliably ensure
- the proper filter function gets used is by naming the route, and using its
- route name with ``url_for``.
-
-Route Path
-----------
-
-*Required*
-
- ``m.connect(``'feeds/:category/atom.xml'``, controller='feeds', action='atom')``
-
-The Route Path determines the URL mapping for the Route. In the above example
-a URL like ``/feeds/electronics/atom.xml`` will match this route.
-
-A Route Path is separated into parts that you define, the naming used when
-referencing the different types of route parts are:
-
-_`Static Part`
- ``m.connect('`` feeds ``/:category/`` atom.xml ``', controller='feeds', action='atom')``
-
- A plain-text part of the URL, this doesn't result in any Route variables.
-
-_`Dynamic Part`
- ``m.connect('feeds/`` :category ``/atom.xml', controller='feeds', action='atom')``
-
- A dynamic part matches text in that part of the URL, and assigns what it
- finds to the name after the ``:`` mark.
-
-_`Wildcard Part`
- ``m.connect('file/`` \*url ``', controller='file', action='serve')``
-
- A wildcard part will match *everything* except the other parts around it.
-
-_`Groupings`
- ``m.connect('article', 'article/:section/:slug/`` :(page) ``.html', ...``
-
- ``m.connect('file/`` \*(url) ``.html', controller='file', action='serve')``
-
- Groupings let you define boundaries for the match with the () characters.
- This allows you to match wildcards and dynamics next to other static and
- dynamic parts. Care should be taken when using Groupings next to each other.
-
-
-Defaults
---------
-
-*Optional*
-
- ``m.connect('history', 'archives/by_eon/:century',``
- controller='archives', action='aggregate', century=1800 ``)``
-
-The keyword options in a route (not including the `requirements`_ keyword arg)
-that can determine the default for a route. If a default is specified for a
-variable that is not a `dynamic part`_, then its not only a default but is also
-a *hardcoded variable*. The ``controller`` and ``action`` are hardcoded
-variables in the example above because despite the URL, they will always be
-'archives' and 'aggregate' respectively.
-
-_`Hardcoded Variable`
- Default keyword that does not exist in the `route path`_. This keyword
- variable cannot be changed by the URL coming in.
-
-Requirements
-------------
-
-*Optional*
-
- ``m.connect('archives/:year/:month/:day', controller='archives', action='view', year=2004,``
- requirements=dict(year='\d{2,4}', month='\d{1,2}') ``)``
-
-Requirements is a special keyword used by Routes to enforce a regular
-expression restriction on the `dynamic part`_ or `wildcard part`_ of a
-`route path`_.
-
-Conditions
-----------
-
-*Optional*
-
- ``m.connect('user/new;preview', controller='user', action='preview',``
- conditions=dict(method=['POST']) ``)``
-
-Conditions specifies a set of special conditions that must be met for the
-route to be accepted as a valid match for the URL. The conditions argument must
-always be a dictionary and can accept 3 different keys.
-
-``method``
- Request must be one of the HTTP methods defined here. This argument must be
- a list of HTTP methods, and should be upper-case.
-``sub_domain``
- Can either be ``True`` or a Python list of sub-domains, one of which must
- be present.
-``function``
- A function that will be used to evaluate if the Route is a match. Must
- return True or False, and will be called with the ``environ`` and
- ``match_dict``. The ``match_dict`` is a dict with all the Route variables
- for the request. Modifications to ``match_dict`` will appear identical to
- Route variables from the original match.
-
-Examples:
-
-.. code-block:: Python
-
- # The method to be either GET or HEAD
- m.connect('user/list', controller='user', action='list',
- conditions=dict(method=['GET', 'HEAD']))
-
-
- # A sub-domain should be present
- m.connect('', controller='user', action='home',
- conditions=dict(sub_domain=True))
-
- # Sub-domain should be either 'fred' or 'george'
- m.connect('', controller='user', action='home',
- conditions=dict(sub_domain=['fred', 'george']))
-
-
- # Put the referrer into the resulting match dictionary, this won't stop the match
- # since it always returns True
- def referals(environ, result):
- result['referer'] = environ.get('HTTP_REFERER')
- return True
- m.connect(':controller/:action/:id', conditions=dict(function=referals))
-
-
--------------------------------
-The Nitty Gritty of Route Setup
--------------------------------
-
-Minimum URLs
-------------
-
-Routes will use your `defaults`_ to try and minimize the required length of
-your URL whenever possible. For example:
-
-.. code-block:: Python
-
- m.connect(':controller/:action/:id', action='view', id=4)
-
- # Will match all of the following
- # /content/view/4
- # /content/view
- # /content
-
-Trailing `dynamic parts <#dynamic-part>`_ of a `route path`_ that have
-`defaults`_ setup are not required to exist in the URL being matched. This
-means that each of the URL examples shown above will result in the same set of
-keyword arguments being sent to the same controller and action.
-
-If a `dynamic part`_ with a default is followed by either
-`static parts <#static-part>`_ or `dynamic parts <#dynamic-part>`_ without
-`defaults`_, that `dynamic part`_ will be required despite having a default:
-
-.. code-block:: Python
-
- # Remember that :action has an implicit default
- m.connect('archives/:action/:article', controller='blog')
-
- # Matches:
- # /archives/view/introduction
- # /archives/edit/recipes
-
- # Does Not Match:
- # /archives/introduction
- # /archives/recipes
-
-This way, the URL coming in maps up to the `route path`_ you created, part
-for part.
-
-When using `Groupings`_, parts will still be left off, but only if the
-remainder of the URL has no static after it. This can lead to some odd looking
-URLs being generated if you aren't careful about your requirements and
-defaults. For example:
-
-.. code-block:: Python
-
- # Groupings without requirements
- m.connect(':controller/:(action)-:(id)')
-
- # Matches:
- # /archives/view-3
- # /archives/view-
-
- # Generation:
- url_for(controller='archives', action='view')
- # /archives/view-
-
-It's unlikely you want such a URL, and would prefer to ensure that there's
-always an id supplied. To enforce this behavior we will use `Requirements`_:
-
-.. code-block:: Python
-
- # Groupings without requirements
- m.connect(':controller/:(action)-:(id)', requirements=dict(id='\d+'))
-
- # Matches:
- # /archives/view-3
- # /archives/view-2
-
- # Does Not Match:
- # /archives/view-
-
- # Generation:
- url_for(controller='archives', action='view', id=2)
- # /archives/view-2
-
-If you end up with URLs missing parts you'd like left on when using
-`Groupings`_, add a requirement to that part.
-
-Implicit Defaults
------------------
-
-The above rule regarding `minimum URLs`_ has two built-in implicit `defaults`_.
-If you use either ``action`` or ``id`` in your `route path`_ and don't specify
-`defaults`_ for them, Routes will automatically assign the following defaults
-to them for you::
-
- action='index', id=None
-
-This is why using the following setup doesn't require an action or id in the
-URL:
-
-.. code-block:: Python
-
- m.connect(':controller/:action/:id')
-
- # '/blog' -> controller='blog', action='index', id=None
-
-Search Order
-------------
-
-When setting up your routes, remember that when `using routes`_ the order in
-which you set them up can affect the URL that's generated. Routes will try and
-use all the keyword args during route generation and if multiple routes can be
-generated given the set of keyword args, the **first and shortest route that
-was connected to the mapper will be used**. `Hardcoded variables
-<#hardcoded-variable>`_ are also used first if available as they typically
-result in shorter URLs.
-
-For example:
-
-.. code-block:: Python
-
- # Route Setup
- m.connect('archives/:year', controller='blog', action='view', year=None)
- m.connect(':controller/:action/:id')
-
- # Route Usage
- url_for(controller='blog', action='view') -> '/archives'
-
-You will typically want your specific and detailed routes at the top of your
-Route setup and the more generic routes at the bottom.
-
-Wildcard Limitations and Gotchas
---------------------------------
-
-Due to the nature of `wildcard parts <#wildcard-part>`_, using wildcards in
-your route path can result in URL matches that you didn't expect. `Wildcard
-parts <#wildcard-part>`_ are extremely powerful and when combined with
-`dynamic parts <#dynamic-part>`_ that have `defaults`_ can confuse the new
-Routes user.
-
-When you have `dynamic parts <#dynamic-part>`_ with `defaults`_, you should
-never place them directly next to a `wildcard part`_. This can result in the
-`wildcard part`_ eating the part in the URL that was intended as the
-`dynamic part`_.
-
-For example:
-
-.. code-block:: Python
-
- m.connect('*url/:username', controller='blog', action='view', username='george')
-
- # When matching url variable username variable
- # /some/long/url/george /some/long/url/george george
- # /some/other/stuff/fred /some/other/stuff/fred george
-
-This occurs because Routes sees the default as being optional, and the
-`wildcard part`_ attempts to gobble as much of the URL as possible before a
-required section of the `route path`_ is found. By having a trailing
-`dynamic part`_ with a default, that section gets dropped.
-
-Notice how removing the `dynamic part`_ default results in the variables we
-expect:
-
-.. code-block:: Python
-
- m.connect('*url/:username', controller='blog', action='view')
-
- # When matching url variable username variable
- # /some/long/url/george /some/long/url george
- # /some/other/stuff/fred /some/other/stuff fred
-
-Let's try one more time, but put in a `static part`_ between the
-`dynamic part`_ with a default and the wildcard:
-
-.. code-block:: Python
-
- m.connect('*url/user/:username', controller='blog', action='view', username='george')
-
- # When matching url variable username variable
- # /some/long/url/user/george /some/long/url george
- # /some/other/stuff/user/fred /some/other/stuff fred
-
-Unicode
--------
-
-Routes by default will assume that incoming parameters are UTF-8 encoded and
-handle the appropriate encoding/decoding. This means that *all* route variables
-will be unicode objects. Should you wish to change the encoding or turn it off
-altogether:
-
-.. code-block:: Python
-
- map = Mapper()
- map.encoding = None # defaults to 'utf-8'
-
- map.connect(':controller/:action/:id')
-
-Individual routes can have their encoding options toggled as well, should a
-specific route want an raw string from the browser. Just add the ``_encoding``
-option to the route:
-
-.. code-block:: Python
-
- map = Mapper()
-
- map.connect('myapp', controller='myapp', action='wsgi', _encoding=None)
- map.connect(':controller/:action/:id')
-
-------------
-Using Routes
-------------
-
-Once you have setup the Routes to map URLs to your controllers and actions, you
-will likely want to generate URLs from within your web application. Routes
-includes two functions for use in your web application that are commonly
-desired.
-
-* `redirect_to <module-routes.html#redirect_to>`_
-* `url_for <module-routes.html#url_for>`_
-
-Both of these functions take a similar set of arguments. The most important
-being a set of keyword arguments that describes the controller, action, and
-additional variables you'd like present for the URL that's created.
-
-To save you from repeating things, Routes has two mechanisms to reduce the
-amount of information you need to supply the url_for or redirect_to function.
-
-Named Routes
-------------
-
-We saw earlier how the `route name`_ ties a set of `defaults`_ to a name. We
-can use this name with our Route functions and its as if we used that set of
-keyword args:
-
-.. code-block:: Python
-
- m.connect('category_home', 'category/:section', controller='blog', action='view',
- section='home')
-
- url_for('category_home')
- # is equivalent to
- url_for(controller='blog', action='view', section='home')
-
-You can also specify keyword arguments and it will override `defaults`_ associated with the `route name`_:
-
-.. code-block:: Python
-
- url_for('category_home', action='index')
- #is equivalent to
- url_for(controller='blog', action='index', section='home')
-
-As you can see, the amount of typing you save yourself by using the `route
-name`_ feature is quite handy.
-
-Using the recently introduced `static named routes`_ feature allows you to
-quickly use common URLs and easily add query arguments:
-
-.. code-block:: Python
-
- m.connect('google_search', 'http://www.google.com/search', _static=True)
-
- url_for('google_search', q='routes')
- # will result in
- # http://www.google.com/search?q=routes
-
-Non-Existent Route Names
-========================
-
-If you supply a `route name`_ that does not exist, ``url_for`` will assume that
-you intend to use the name as the actual URL. It will also prepend it with the
-proper WSGI ``SCRIPT_NAME`` if applicable:
-
-.. code-block:: Python
-
- url_for('/css/source.css')
- # if running underneath a 'mount' point of /myapp will become
- # /myapp/css/source.css
-
-For portable web applications, it's highly encouraged that you use ``url_for``
-for all your URLs, even those that are static resources and images. This will
-ensure that the URLs are properly handled in various deployment cases.
-
-Route Memory
-------------
-
-When your controller and action is matched up from the URL, the variables it
-set to get there are preserved. This lets you update small bits of the keywords
-that got you there without specifying the entire thing:
-
-.. code-block:: Python
-
- m.connect('archives/:year/:month/:day', controller='archives',
- action='view', year=2004,
- requirements=dict(year='\d{2,4}', month='\d{1,2}'))
-
- # URL used: /archives/2005/10/4
-
- # Route dict: {'controller': 'archives', 'action': 'view', 'year': '2005',
- # 'month': '10', 'day': '4'}
-
- url_for(day=6) # => /archives/2005/10/6
- url_for(month=4) # => /archives/2005/4/4
- url_for() # => /archives/2005/10/4
- url_for(controller='/archives') # => /archives
-
-The route memory is always used for values with the following conditions:
-
-* If the controller name begins with a ``/``, no values from the Route dict
- are used
-* If the controller name changes and no action is specified, action will be set
- to 'index'
-* If you use `named routes`_, no values from the Route dict are used
-
-Overriding Route Memory
------------------------
-
-Sometimes one doesn't want to have `Route Memory`_ present, as well as removing
-the `Implicit Defaults`_. Routes can disable route memory and implicit defaults
-either globally, or on a per-route basis. Setting explicit routes:
-
-.. code-block:: Python
-
- m = Mapper(explicit=True)
-
-When toggling explicit behavior for individual routes, only the implicit route
-defaults will be de-activated. ``url_for`` behavior can only be set globally
-with the mapper explicit keyword. Setting explicit behavior for a route:
-
-.. code-block:: Python
-
- m = Mapper()
-
- # Note no 'id' value will be assumed for a default
- m.connect('archives/:year', controller='archives', action='view',
- _explicit=True)
-
- # This will now require an action and id present
- m.connect(':controller/:action/:id', _explicit=True)
-
-------------------
-Sub-domain Support
-------------------
-
-Routes comes with sub-domain support to make it easy to handle sub-domains in
-an integrated fashion. When sub-domain support is turned on, Routes will always
-have a ``sub_domain`` argument present with the sub-domain if present, or None.
-
-To avoid matching common aliases to your main domain like ``www``, the
-sub-domain support can be set to ignore some sub-domains.
-
-Example:
-
-.. code-block:: Python
-
- # Turn on sub-domain support
- map.sub_domains = True
-
- # Ignore the www sub-domain
- map.sub_domains_ignore = ['www']
-
-Generating URL's with sub-domains
----------------------------------
-
-When sub-domain support is on, the ``url_for`` function will accept a
-``sub_domain`` keyword argument. Routes will then ensure that the generated URL
-has the sub-domain indicated. This feature works with Route memory to ensure
-that the sub-domain is only added when necessary.
-
-Some examples:
-
-.. code-block:: Python
-
- # Assuming that the current URL from the request is http://george.example.com/users/edit
- # Also assuming that you're using the map options above with the default routing of
- # ':controller/:action/:id'
- url_for(action='update', sub_domain='fred') # -> http://fred.example.com/users/update
-
- url_for(controller='/content', action='view', sub_domain='www')
- # will become -> http://example.com/content/view
-
- url_for(action='new', sub_domain=None) # -> http://example.com/users/new
-
-----------------
-RESTful Services
-----------------
-
-To make it easier to setup RESTful web services with Routes, there's a shortcut
-Mapper method that will setup a batch of routes for you along with conditions
-that will restrict them to specific HTTP methods. This is directly styled on
-the Rails version of ``map.resource``, which was based heavily on the Atom
-Publishing Protocol.
-
-The ``map.resource`` command creates a set of Routes for common operations on
-a collection of resources, individually referred to as 'members'. Consider the
-common case where you have a system that deals with users. In that case
-operations dealing with the entire group of users (or perhaps a subset) would
-be considered *collection* methods. Operations (or actions) that act on an
-individual member of that collection are considered *member* methods. These
-terms are important to remember as the options to ``map.resource`` rely on a
-clear understanding of *collection* actions vs. *member* actions.
-
-View a `complete list with examples of the map.resource options <class-routes.base.Mapper.html#resource>`_.
-
-The default mapping that map.resource sets up looks like this:
-
-.. code-block:: Python
-
- map.resource('message', 'messages')
-
- # Will setup all the routes as if you had typed the following map commands:
- map.connect('messages', controller='messages', action='create',
- conditions=dict(method=['POST']))
- map.connect('messages', 'messages', controller='messages', action='index',
- conditions=dict(method=['GET']))
- map.connect('formatted_messages', 'messages.:(format)', controller='messages', action='index',
- conditions=dict(method=['GET']))
- map.connect('new_message', 'messages/new', controller='messages', action='new',
- conditions=dict(method=['GET']))
- map.connect('formatted_new_message', 'messages/new.:(format)', controller='messages', action='new',
- conditions=dict(method=['GET']))
- map.connect('messages/:id', controller='messages', action='update',
- conditions=dict(method=['PUT']))
- map.connect('messages/:id', controller='messages', action='delete',
- conditions=dict(method=['DELETE']))
- map.connect('edit_message', 'messages/:(id);edit', controller='messages, action='edit',
- conditions=dict(method=[''GET']))
- map.connect('formatted_edit_message', 'messages/:(id).:(format);edit', controller='messages,
- action='edit', conditions=dict(method=[''GET']))
- map.connect('message', 'messages/:id', controller='messages', action='show',
- conditions=dict(method=['GET']))
- map.connect('formatted_message', 'messages/:(id).:(format)', controller='messages', action='show',
- conditions=dict(method=['GET']))
-
-The most important aspects of this is the following mapping that is established::
-
- GET /messages -> messages.index() -> url_for('messages')
- POST /messages -> messages.create() -> url_for('messages')
- GET /messages/new -> messages.new() -> url_for('new_message')
- PUT /messages/1 -> messages.update(id) -> url_for('message', id=1)
- DELETE /messages/1 -> messages.delete(id) -> url_for('message', id=1)
- GET /messages/1 -> messages.show(id) -> url_for('message', id=1)
- GET /messages/1;edit -> messages.edit(id) -> url_for('edit_message', id=1)
-
-.. Note::
- Several of these methods map to functions intended to display forms. The
- new message method should be used to return a form allowing someone to
- create a new message, while it should POST to /messages. The edit message
- function should work similarly returning a form to edit a message, which
- then posts a PUT to the /messages/1 resource.
-
-Additional methods that respond to either a new member, or different ways of
-viewing collections can be added via keyword arguments to ``map.resource`` as
-shown in the `complete list with examples of the map.resource options
-<class-routes.base.Mapper.html#resource>`_.
-
---------------------
-Additional Resources
---------------------
-
-*These resources may refer to Ruby/Rails route setup*
-
-* `Rails Routes book <http://manuals.rubyonrails.com/read/book/9>`_
-* `Rails Named Routes How-To <http://wiki.rubyonrails.com/rails/pages/NamedRoutes>`_
diff --git a/docs/modules.rst b/docs/modules.rst
new file mode 100644
index 0000000..66da0c5
--- /dev/null
+++ b/docs/modules.rst
@@ -0,0 +1,22 @@
+:mod:`routes` -- Routes module
+================================================
+
+.. automodule:: routes
+
+Module Contents
+---------------
+
+.. currentmodule:: routes
+
+.. autofunction:: request_config
+
+.. autoclass:: Mapper
+ :members: connect, create_regs, generate, match, redirect, resource, routematch
+.. autoclass:: URLGenerator
+
+.. currentmodule:: routes.middleware
+
+.. autoclass:: RoutesMiddleware
+.. autofunction:: strip_slashes
+.. autofunction:: url_for
+.. autofunction:: redirect_to
diff --git a/docs/pudge_template/SyntaxHighlighter.css b/docs/pudge_template/SyntaxHighlighter.css
deleted file mode 100644
index 5cd272f..0000000
--- a/docs/pudge_template/SyntaxHighlighter.css
+++ /dev/null
@@ -1,249 +0,0 @@
-/* Main style for the table */
-
-.dp-highlighter
-{
- font-family: "Courier New" , Courier, mono;
- font-size: 11px;
- background-color: #eee;
- width: 99%;
- overflow: auto;
- line-height: 100% !important;
- margin: 18px 0px 18px 0px;
-}
-
-
-.dp-highlighter .bar
-{
- padding-left: 45px;
-}
-
-.dp-highlighter ol
-{
- margin: 0px;
- padding: 0px;
- padding-left: 45px;
- background-color: #eee;
- color: gray;
-}
-
-.dp-highlighter ol li, .dp-highlighter .columns div
-{
- border-left: 1px solid gray;
- background-color: #fff;
- padding-left: 10px;
- line-height: 14px;
-}
-
-.dp-highlighter .columns
-{
- color: gray;
- overflow: hidden;
- width: 100%;
-}
-
-.dp-highlighter .columns div
-{
- padding-bottom: 5px;
-}
-
-.dp-highlighter ol li.alt
-{
- background-color: #f8f8f8;
-}
-
-.dp-highlighter ol li span
-{
- color: Black;
-}
-
-/* Adjust some properties when wollapsed */
-
-.dp-highlighter.collapsed ol
-{
- margin: 0px;
-}
-
-.dp-highlighter.collapsed ol li
-{
- display: none;
-}
-
-.dp-highlighter.collapsed .tools
-{
- border-bottom: none;
-}
-
-/* Additional modifications when in print-view */
-
-.dp-highlighter.printing
-{
- border: none;
-}
-
-.dp-highlighter.printing .tools
-{
- display: none !important;
- border: 5px solid black;
-}
-
-.dp-highlighter.printing li
-{
- display: list-item !important;
-}
-
-/* Styles for the tools */
-
-.dp-highlighter .tools
-{
- background-color: #eee;
- padding: 3px 8px 3px 10px;
- border-bottom: 1px solid gray;
- font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
- color: silver;
-}
-
-.dp-highlighter .tools a
-{
- font-size: 9px;
- color: gray;
- text-decoration: none;
- margin-right: 10px;
-}
-
-.dp-highlighter .tools a:hover
-{
- color: red;
- text-decoration: underline;
-}
-
-/* About dialog styles */
-
-.dp-about
-{
- background-color: #fff;
- margin: 0px;
-}
-
-.dp-about table
-{
- width: 100%;
- height: 100%;
- font-size: 11px;
- font-family: Tahoma, Verdana, Arial, sans-serif !important;
-}
-
-.dp-about td
-{
- padding: 10px;
- vertical-align: top;
-}
-
-.dp-about .copy
-{
- border-bottom: 1px solid #ACA899;
- height: 95%;
-}
-
-.dp-about .title
-{
- color: red;
- font-weight: bold;
-}
-
-.dp-about .para
-{
- margin-bottom: 4px;
-}
-
-.dp-about .footer
-{
- background-color: #ECEADB;
- border-top: 1px solid #fff;
- text-align: right;
-}
-
-.dp-about .close
-{
- font-size: 11px;
- font-family: Tahoma, Verdana, Arial, sans-serif !important;
- background-color: #ECEADB;
- width: 60px;
- height: 22px;
-}
-
-/* Language specific styles */
-
-.dp-c {}
-.dp-c .comment { color: green; }
-.dp-c .string { color: blue; }
-.dp-c .preprocessor { color: gray; }
-.dp-c .keyword { color: blue; }
-.dp-c .vars { color: #d00; }
-
-.dp-vb {}
-.dp-vb .comment { color: green; }
-.dp-vb .string { color: blue; }
-.dp-vb .preprocessor { color: gray; }
-.dp-vb .keyword { color: blue; }
-
-.dp-sql {}
-.dp-sql .comment { color: green; }
-.dp-sql .string { color: red; }
-.dp-sql .keyword { color: blue; }
-.dp-sql .func { color: #ff1493; }
-.dp-sql .op { color: #808080; }
-
-.dp-xml {}
-.dp-xml .cdata { color: #ff1493; }
-.dp-xml .comments { color: green; }
-.dp-xml .tag { font-weight: bold; color: blue; }
-.dp-xml .tag-name { color: black; font-weight: bold; }
-.dp-xml .attribute { color: red; }
-.dp-xml .attribute-value { color: blue; }
-
-.dp-delphi {}
-.dp-delphi .comment { color: #008200; font-style: italic; }
-.dp-delphi .string { color: blue; }
-.dp-delphi .number { color: blue; }
-.dp-delphi .directive { color: #008284; }
-.dp-delphi .keyword { font-weight: bold; color: navy; }
-.dp-delphi .vars { color: #000; }
-
-.dp-py {}
-.dp-py .comment { color: green; }
-.dp-py .string { color: red; }
-.dp-py .docstring { color: green; }
-.dp-py .keyword { color: blue; font-weight: bold;}
-.dp-py .builtins { color: #ff1493; }
-.dp-py .magicmethods { color: #808080; }
-.dp-py .exceptions { color: brown; }
-.dp-py .types { color: brown; font-style: italic; }
-.dp-py .commonlibs { color: #8A2BE2; font-style: italic; }
-
-.dp-rb {}
-.dp-rb .comment { color: #c00; }
-.dp-rb .string { color: #f0c; }
-.dp-rb .symbol { color: #02b902; }
-.dp-rb .keyword { color: #069; }
-.dp-rb .variable { color: #6cf; }
-
-.dp-css {}
-.dp-css .comment { color: green; }
-.dp-css .string { color: red; }
-.dp-css .keyword { color: blue; }
-.dp-css .colors { color: darkred; }
-.dp-css .vars { color: #d00; }
-
-.dp-j {}
-.dp-j .comment { color: rgb(63,127,95); }
-.dp-j .string { color: rgb(42,0,255); }
-.dp-j .keyword { color: rgb(127,0,85); font-weight: bold }
-.dp-j .annotation { color: #646464; }
-.dp-j .number { color: #C00000; }
-
-.dp-paste-ini {}
-.dp-paste-ini .comment { color: red }
-.dp-paste-ini .header { color: blue }
-.dp-paste-ini .use { color: green }
-.dp-paste-ini .interp-variable { color: #FF6600 }
-.dp-paste-ini .variable { color: #990099 }
diff --git a/docs/pudge_template/layout.css b/docs/pudge_template/layout.css
deleted file mode 100644
index 4ba81a8..0000000
--- a/docs/pudge_template/layout.css
+++ /dev/null
@@ -1,120 +0,0 @@
-@import url("pudge.css");
-@import url("site.css");
-
-/* Basic Style
------------------------------------ */
-
-h1.pudge-member-page-heading {
-}
-h4.pudge-member-page-subheading {
- font-style: italic;
- margin-top: -1.0em;
- margin-left: 2em;
- margin-bottom: .3em;
- color: #aaa; /* #FF5000 */
-}
-p.pudge-member-blurb {
- font-style: italic;
- font-weight: bold;
- font-size: 120%;
- margin-top: 0.2em;
- color: #999;
-}
-p.pudge-member-parent-link {
- margin-top: 0;
-}
-/*div.pudge-module-doc {
- max-width: 45em;
-}*/
-div.pudge-section {
- margin-left: 2em;
- max-width: 45em;
-}
-/* Section Navigation
------------------------------------ */
-
-div#pudge-section-nav
-{
- margin: 1em 0 1.5em 0;
- padding: 0;
- height: 20px;
-}
-
-div#pudge-section-nav ul {
- border: 0;
- margin: 0;
- padding: 0;
- list-style-type: none;
- text-align: center;
- border-right: 1px solid #aaa;
-}
-div#pudge-section-nav ul li
-{
- display: block;
- float: left;
- text-align: center;
- padding: 0;
- margin: 0;
-}
-
-div#pudge-section-nav ul li .pudge-section-link,
-div#pudge-section-nav ul li .pudge-missing-section-link
-{
- background: #aaa;
- width: 9em;
- height: 1.8em;
- border: 1px solid #bbb;
- padding: 0;
- margin: 0 0 10px 0;
- color: #ddd;
- text-decoration: none;
- display: block;
- text-align: center;
- font: 11px/20px "Verdana", "Lucida Grande";
- cursor: hand;
- text-transform: lowercase;
-}
-
-div#pudge-section-nav ul li a:hover {
- color: #000;
- background: #fff;
-}
-
-div#pudge-section-nav ul li .pudge-section-link {
- background: #888;
- color: #eee;
- border: 1px solid #bbb;
-}
-
-/* Module Lists
------------------------------------ */
-dl.pudge-module-list dt {
- font-style: normal;
- font-size: 110%;
-}
-dl.pudge-module-list dd {
- color: #555;
-}
-
-/* Misc Overrides */
-.rst-doc p.topic-title a {
- color: #777;
-}
-.rst-doc ul.auto-toc a,
-.rst-doc div.contents a {
- color: #333;
-}
-pre { background: #eee; }
-
-.rst-doc dl dt {
- color: #444;
- margin-top: 1em;
- font-weight: bold;
-}
-.rst-doc dl dd {
- margin-top: .2em;
-}
-.rst-doc hr {
- display: block;
- margin: 2em 0;
-} \ No newline at end of file
diff --git a/docs/pudge_template/layout.html b/docs/pudge_template/layout.html
deleted file mode 100644
index fbe4314..0000000
--- a/docs/pudge_template/layout.html
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0"?>
-<?python
-import pudge
-
-def initialize(t):
- g = t.generator
- if not hasattr(t, 'title'):
- t.title = 'Untitled'
- t.doc_title = g.index_document['title']
- t.home_url = g.organization_url or g.blog_url or g.trac_url
- t.home_title = g.organization
- if hasattr(t, 'parts'):
- t.docroot = t.parts.get('docroot', '')
- else:
- t.docroot = ''
- links = []
- for name, value in t.settings.items():
- if name.startswith('link'):
- if len(value.split()) == 1:
- print "Bad link: should be URL<space>title: %r" % value
- continue
- url, title = value.split(None, 1)
- links.append((name, url.strip(), title.strip()))
- links.sort()
- t.links = [(u, title) for (n, u, title) in links]
-?>
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:py="http://purl.org/kid/ns#"
- py:def="layout">
-
- <head>
- <title>${title}</title>
- <link rel="stylesheet" type="text/css" href="${docroot}layout.css"/>
- <link py:if="generator.syndication_url"
- rel="alternate"
- type="application/rss+xml"
- title="RSS 2.0" href="${generator.syndication_url}"/>
-
- </head>
- <body>
- <div id="page">
- <h1 class="doc-title"><a href="${home_url}">${home_title}</a></h1>
- <div id="navcontainer">
- <ul id="navlist">
- <li class="pagenav">
- <ul>
- <li class="page_item">
- <a href="${docroot}index.html"
- title="Project Home / Index">${doc_title}</a>
- </li>
- <li class="page_item">
- <a href="${docroot}module-index.html"
- title="${doc_title.lower()} package and module reference">Modules</a>
- </li>
- <?python
- trac_url = generator.trac_url
- mailing_list_url = generator.mailing_list_url
- ?>
- <li py:if="trac_url">
- <a href="${trac_url}"
- title="Wiki / Subversion / Roadmap / Bug Tracker"
- >Trac</a>
- </li>
- <li py:if="generator.blog_url">
- <a href="${generator.blog_url}">Blog</a>
- </li>
- <li py:if="mailing_list_url">
- <a href="${mailing_list_url}"
- title="Mailing List">Discuss</a>
- </li>
- <li class="page_item"
- py:if="not self.settings.get('no_about')">
- <a href="${home_url}about">about ${home_title}
- </a>
- </li>
- <li py:for="url, title in links">
- <a href="${url}">${title}</a>
- </li>
- </ul>
- </li>
- </ul>
- </div>
-
- <hr />
-
- <div id="content" py:content="content()"/>
-
- <div id="footer">
- <?python license = generator.get_document('doc-license') ?>
-
- <p style="float: left;">
- <span py:if="license" py:strip="1">
- This documentation is licensed under the
- <a href="${license['basename']}.html"
- title="Documentation License"
- >${license['title']}</a>
- <br/>
- </span>
- built with
- <a href="http://lesscode.org/projects/pudge/"
- >pudge/${pudge.__version__}</a> |
- original design by
- <a href="http://blog.ratterobert.com/"
- >ratter / robert</a>
- <span py:if="self.settings.get('extra_credits')">
- | <span py:replace="XML(self.settings['extra_credits'])"/>
- </span>
- </p>
- </div>
- </div>
- </body>
-
-</html>
diff --git a/docs/pudge_template/pudge.css b/docs/pudge_template/pudge.css
deleted file mode 100644
index b370217..0000000
--- a/docs/pudge_template/pudge.css
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Layout
------------------------------------ */
-
-@import url("rst.css");
-
-/* Pudge Elements
------------------------------------ */
-.note { font-size: 90% }
-h4.pudge-member-name {
- font-size: 110%;
- margin-bottom: 0;
-}
-h4.pudge-member-name a.obj-link {
- font-weight: bold;
- text-decoration: none;
-}
-h4.pudge-member-name .prefix {
- font-style: oblique;
- padding-right: 6px;
- font-weight: bold;
- color: #c9c;
-}
-h1.pudge-member-page-heading {
- font-size: 250%;
-}
-h4.pudge-member-page-subheading {
- font-size: 150%;
- font-style: italic;
-}
-h4.pudge-member-page-subheading p {
- display: inline;
-}
-div.pudge-member {
- margin-top: 1.5em;
- margin-bottom: 1.5em;
-}
-ul.pudge-module-index {
- margin-left: 0;
- padding-left: 0;
-}
-ul.pudge-module-index ul {
- padding-left: 1.5em;
- margin-left: 0;
-}
-ul.pudge-module-index li {
- list-style-type: none;
-}
-ul.pudge-module-index .prefix {
- font-style: oblique;
- padding-right: 6px;
- font-size: 90%;
- font-weight: bold;
- color: purple;
-}
-ul.pudge-module-index a {
- text-decoration: none;
-}
-div.pudge-section {
- margin-left: 2em;
-} \ No newline at end of file
diff --git a/docs/pudge_template/rst.css b/docs/pudge_template/rst.css
deleted file mode 100644
index 3dc28bd..0000000
--- a/docs/pudge_template/rst.css
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
-:Author: David Goodger, Ian Bicking
-:Contact: ianb@colorstudy.com
-:date: $Date: 2003/11/01 20:35:45 $
-:version: $Revision: 1.3 $
-:copyright: This stylesheet has been placed in the public domain.
-
-A modification of the default cascading style sheet (v.1.3) for the
-HTML output of Docutils.
-*/
-
-div#contents p.topic-title a {
- display: none;
-}
-
-em, i {
- /* Typically serif fonts have much nicer italics */
- font-family: Times New Roman, Times, serif;
-}
-
-ul li {
- list-style-type: circle;
-}
-
-a.toc-backref {
- text-decoration: none;
- color: black;
-}
-
-a.toc-backref:hover {
- background-color: inherit;
-}
-
-h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6:hover {
- background-color: inherit;
-}
-
-cite {
- font-style: normal;
- font-family: monospace;
- font-weight: bold;
-}
-
-dd {
- margin-bottom: 0.5em;
-}
-
-div.abstract {
- margin: 2em 5em;
-}
-
-div.abstract p.topic-title {
- font-weight: bold;
- text-align: center;
-}
-
-div.attention, div.caution, div.danger, div.error, div.hint,
-div.important, div.note, div.tip, div.warning {
- background-color: #ccc;
- width: 40%;
- border: medium outset;
- padding: 3px;
- float: right
- line-height: normal;
-}
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
- color: #c00;
- font-weight: bold;
- font-family: sans-serif;
- text-align: center;
- background-color: #999;
- display: block;
- margin: 0;
-}
-
-div.hint p.admonition-title, div.important p.admonition-title,
-div.note p.admonition-title, div.tip p.admonition-title {
- font-weight: bold;
- font-family: sans-serif;
- text-align: center;
- background-color: #999;
- display: block;
- margin: 0;
-}
-
-div.dedication {
- margin: 2em 5em;
- text-align: center;
- font-style: italic;
-}
-
-div.dedication p.topic-title {
- font-weight: bold;
- font-style: normal;
-}
-
-div.figure {
- margin-left: 2em;
-}
-
-div.footer, div.header {
- font-size: smaller;
-}
-
-div.system-messages {
- margin: 5em;
-}
-
-div.system-messages h1 {
- color: red;
-}
-
-div.system-message {
- border: medium outset;
- padding: 1em;
-}
-
-div.system-message p.system-message-title {
- color: red;
- font-weight: bold;
-}
-
-div.topic {
- margin: 2em;
-}
-
-h3 a.toc-backref, h4 a.toc-backref, h5 a.toc-backref,
-h6 a.toc-backref {
- color: #000;
-}
-
-h1.title {
- text-align: center;
-}
-
-h2.subtitle {
- text-align: center;
-}
-
-hr {
- width: 75%;
-}
-
-ol.simple, ul.simple {
- margin-bottom: 1em;
-}
-
-ul.contents li {
- list-style: none;
- margin: 0;
- padding: 0;
-}
-
-ul.contents {
- position: fixed;
- top: 0px;
- right: 0px;
- background-color: #fd9;
- border-left: 1px solid #f70;
- border-bottom: 1px solid #f70;
- width: 200px;
- padding: 0;
- margin: 0;
-}
-
-ul.contents a {
- padding: 2px 1em 2px 1em;
- display: block;
- text-decoration: none;
- color: #400;
-}
-
-ul.contents a:hover {
- background-color: #f80;
- color: #fff;
-}
-
-ul.contents li.header {
- padding: 5px 1px 3px 0;
- font-weight: bold;
-}
-
-ol.arabic {
- list-style: decimal;
-}
-
-ol.loweralpha {
- list-style: lower-alpha;
-}
-
-ol.upperalpha {
- list-style: upper-alpha;
-}
-
-ol.lowerroman {
- list-style: lower-roman;
-}
-
-ol.upperroman {
- list-style: upper-roman;
-}
-
-p.caption {
- font-style: italic;
-}
-
-p.credits {
- font-style: italic;
- font-size: smaller;
-}
-
-p.first {
- margin-top: 0;
-}
-
-p.label {
- white-space: nowrap;
-}
-
-p.topic-title {
- font-weight: bold;
-}
-
-pre.address {
- margin-bottom: 0;
- margin-top: 0;
- font-family: serif;
- font-size: 100%;
-}
-
-pre.line-block {
- font-family: serif;
- font-size: 100%;
-}
-
-pre.literal-block, pre.doctest-block {
- margin-left: 2em;
- margin-right: 2em;
- background-color: #eee;
- border: thin black solid;
- padding: 5px;
-}
-
-span.classifier {
- font-family: sans-serif;
- font-style: oblique;
-}
-
-span.classifier-delimiter {
- font-family: sans-serif;
- font-weight: bold;
-}
-
-span.interpreted {
- font-family: sans-serif;
-}
-
-span.option-argument {
- font-style: italic;
-}
-
-span.pre {
- white-space: pre;
-}
-
-span.problematic {
- color: red;
-}
-
-table {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
-
-table.citation {
- border-left: solid thin gray;
- padding-left: 0.5ex
-}
-
-table.docinfo {
-}
-
-table.footnote {
- border-left: solid thin black;
- padding-left: 0.5ex;
-}
-
-td, th {
- padding-left: 0.5em;
- padding-right: 0.5em;
- vertical-align: top;
-}
-
-td > p:first-child, th > p:first-child {
- margin-top: 0em;
-}
-
-th.docinfo-name, th.field-name {
- font-weight: bold;
- text-align: left;
- white-space: nowrap;
-}
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
- font-size: 100%;
-}
-
-code, tt {
- color: #006;
-}
-
-ul.auto-toc {
- list-style-type: none;
-}
-
-/*****************************************
- * Doctest embedded examples
- *****************************************/
-
-span.doctest-url {
- background-color: #eee;
- border-top: 2px outset #666;
- border-left: 2px outset #666;
- border-right: 2px outset #666;
- padding: 0.25em;
-}
-
-div.doctest-example {
- border: outset 5px #666;
- background-color: #eee;
- font-family: default;
- padding: 0.5em;
-}
-
-div.doctest-example h1 {
- background-color: inherit;
- border: none;
- color: inherit;
- font-family: default;
-}
-
-div.doctest-example tt {
- color: inherit;
-}
-
-div.doctest-status {
- background-color: #060;
- color: #fff;
-}
-
-span.doctest-header {
- background-color: #ccc;
- font-family: monospace;
-}
-
-pre.doctest-errors {
- border: none;
- background-color: #333;
- color: #600;
-}
-
-div.source-code {
- background-color: #000;
- border: inset #999 3px;
- overflow: auto;
-}
-
-pre.source-code {
- background-color: #000;
- border: inset #999 3px;
- overflow: auto;
- font-family: monospace;
- color: #fff;
-}
-
-span.source-filename {
- background-color: #000;
- border-top: 2px outset #999;
- border-left: 2px outset #999;
- border-right: 2px outset #999;
- padding: 0.25em;
- color: #fff
-}
-
diff --git a/docs/pudge_template/site.css b/docs/pudge_template/site.css
deleted file mode 100644
index 0b61ba0..0000000
--- a/docs/pudge_template/site.css
+++ /dev/null
@@ -1,290 +0,0 @@
-/* This is a generated, using these settings:
- {'extra_credits': 'Development Sponsored by <a href="http://www.parachute.com/">Parachute LLC.</a>', 'link2': '/download/ Download', 'link1': '/community/ Community', 'no_about': 'true'} */
-i, em {
- font-family: Times New Roman,Times,serif;
-}
-
-a, a:link {
-color: #234cb5;
-text-decoration: none;
-border-bottom: 1px dotted #234cb5;
-}
-
-a:hover { color: #479ec6;
- border-bottom: 1px solid #479ec6; }
-
-/*
-Theme Name: Almodovar
-Theme URI: http://blog.ratterobert.com/archiv/2005/03/09/almodovar/
-Description: Das Theme basiert im Ursprung auf Michael Heilemanns Kubrick-Template und ist von dem einen oder anderen Gimmick anderer sehr guter Templates inspiriert worden.
-Version: 0.7
-Author: ratte / robert
-Author URI: http://blog.ratterobert.com/
-*/
-
-/* Begin Typography & Colors */
-body {
- font-family: 'Lucida Grande', 'Trebuchet MS', 'Bitstream Vera Sans', Sans-Serif;
- background: #c6c9ce url(/images/backdrop.gif) repeat-x;
- text-align: center;
- font-size: 92%;
-}
-
-#page {
- background-color: #fff;
- border: 1px solid #000;
- text-align: left;
-}
-
-#content {
- margin: 0;
- }
-
-#content p,
-#content ul,
-#content blockquote {
- line-height: 1.6em;
-}
-
-#footer {
- border-top: 1px solid #000;
- margin-top: 2em;
- color: #666;
- font-size: 75%;
-}
-
-#footer a:link, #footer a:visited {
- font-weight: normal;
-}
-
-small {
- font-family: 'Trebuchet MS', Arial, Helvetica, Sans-Serif;
- font-size: 0.9em;
- line-height: 1.5em;
- }
-
-h1, h2, h3 {
- font-family: Verdana, sans-serif;
- font-weight: bold;
- margin-top: .7em;
- margin-bottom: .7em;
- }
-
-h1 {
- text-decoration: none;
- text-shadow: #ccc 3px 3px 3px;
- border: none;
- font-size: 2.0em;
-}
-h2 {
- font-size: 1.75em;
-}
-h3 {
- font-size: 1.25em;
-}
-
-div#content h1, div#content h2, div#content h3 {
- color: #234cb5;
- border-bottom: 2px solid #f95_;
-}
-
-h1 a, h2 a, h3 a {
- color: #234cb5;
-}
-
-h1, h1 a, h1 a:hover, h1 a:visited,
-h2, h2 a, h2 a:hover, h2 a:visited,
-h3, h3 a, h3 a:hover, h3 a:visited,
-cite {
- text-decoration: none;
-}
-
-small, blockquote, strike {
- color: #555;
-}
-
-#links ul ul li, #links li {
- list-style: none;
-}
-
-code {
- font: 1.1em 'Courier', 'Courier New', Fixed;
-}
-
-acronym, abbr, span.caps {
- font-size: 0.9em;
- letter-spacing: .07em;
-}
-
-/* Special case doc-title */
-h1.doc-title {
- font-family: Verdana, sans-serif;
- font-size: 2.4em;
- margin: 0;
- text-shadow: #444 -2px -2px 2px;
-}
-h1.doc-title a {
- display: block;
- padding-left: 0.8em;
- padding-bottom: .2em;
- padding-top: .5em;
- margin: 0;
- border-bottom: 1px #fff solid;
-}
-h1.doc-title,
-h1.doc-title a,
-h1.doc-title a:visited,
-h1.doc-title a:hover {
- text-decoration: none;
- color: #4A72D9;
-}
-/* End Typography & Colors */
-
-
-/* Begin Structure */
-body {
- margin: 0;
- padding: 0;
-}
-
-#page {
- background-color: white;
- margin: 0 auto 0 5em;
- padding: 0;
- max-width: 60em;
- border: 1px solid #000;
-}
-* html #page {
- width: 60em;
-}
-
-#content {
- margin: 0 1em 0 3em;
-}
-
-#content h1 {
- margin-left: 0;
-}
-
-#footer {
- padding: 0 0 0 1px;
- margin: 0;
- margin-top: 1.5em;
- clear: both;
- }
-
-#footer p {
- margin: 1em;
- }
-
-/* End Structure */
-
-
-
-/* Begin Headers */
-.description {
- text-align: center;
- }
-
-/* End Headers */
-
-
-/* Begin Form Elements */
-#searchform {
- margin: 1em auto;
- text-align: right;
- }
-
-#searchform #s {
- width: 100px;
- padding: 2px;
- }
-
-#searchsubmit {
- padding: 1px;
- }
-/* End Form Elements */
-
-
-/* Begin Various Tags & Classes */
-acronym, abbr, span.caps {
- cursor: help;
-}
-
-acronym, abbr {
- border-bottom: 1px dashed #999;
-}
-
-blockquote {
- margin: 15px 30px 0 10px;
- padding-left: 20px;
- border-left: 5px solid #ccc;
-}
-
-blockquote cite {
- margin: 5px 0 0;
- display: block;
-}
-
-hr {
- display: none;
-}
-
-a img {
- border: none;
-}
-
-.navigation {
- display: block;
- text-align: center;
- margin-top: 10px;
- margin-bottom: 60px;
-}
-/* End Various Tags & Classes*/
-
-span a { color: #CCC; }
-
-span a:hover { color: #FF5000; }
-
-#navcontainer {
- margin-top: 0px;
- padding-top: 0px;
- width: 100%;
- border-bottom: 1px solid black;
-}
-
-#navlist {
- margin: 0;
- margin-top: 8px;
-}
-
-#navlist ul {
- margin-left: 0;
- margin-right: 5px;
- padding-left: 0;
- white-space: nowrap;
-}
-
-#navlist li {
- display: inline;
- list-style-type: none;
-}
-
-#navlist a {
- padding: 0px 10px;
- margin-right: 5px;
- margin-bottom: 0px;
- color: #fff;
- background-color: #7D9AE3;
- text-decoration: none;
- border: 1px solid #000;
- border-width: 1px 1px 0px 1px;
- font-weight: normal;
-}
-
-#navlist a:hover {
- color: #000;
- background-color: #fff;
- text-decoration: none;
- font-weight: normal;
-}
diff --git a/docs/recipes.txt b/docs/recipes.txt
deleted file mode 100644
index 3715036..0000000
--- a/docs/recipes.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-==============
- Route Recipes
-==============
-
-A few common things people will most likely want to setup with Routes.
-
-Adding a Root/Default Page
-==========================
-
-Despite being considered the default route, ``m.connect(':controller/:action/:id')`` *won't actually call any of your controllers if you give it a URL like '/'*. When many people think of their *default page*, they're thinking about what happens when you go to ``http://somehost.com/``.
-
-To setup a controller/action to handle this case, the `route path <manual.html#route-path>`_ will actually be
-empty. Here's an example::
-
- m.connect('', controller='blog', action='index')
-
- # Or for a named home route
- m.connect('home', '', controller='blog', action='index')
-
- # Which you then could use like so:
- url_for('home')
-
-Special Processing of a File
-============================
-
-Perhaps you have a set of normal files available, and would like to enable a special operation on them. In
-this case we'll use a fictitious action called ``filter`` that is assumed to exist for our controllers::
-
- m.connect('*file/:controller', action=filter)
-
-Now we can match any URL that has a valid ``controller`` name at the end of it. This is then called with everything
-before the controller as the ``file`` keyword argument. \ No newline at end of file
diff --git a/routes/__init__.py b/routes/__init__.py
index 1295a2e..21bbc09 100644
--- a/routes/__init__.py
+++ b/routes/__init__.py
@@ -5,8 +5,8 @@ class _RequestConfig(object):
"""
RequestConfig thread-local singleton
- The Routes RequestConfig object is a thread-local singleton that should be initialized by
- the web framework that is utilizing Routes.
+ The Routes RequestConfig object is a thread-local singleton that should
+ be initialized by the web framework that is utilizing Routes.
"""
__shared_state = threadinglocal.local()
@@ -106,8 +106,9 @@ def request_config(original=False):
**Using your own requst local**
- If you have your own request local object that you'd like to use instead of the default
- thread local provided by Routes, you can configure Routes to use it::
+ If you have your own request local object that you'd like to use instead
+ of the default thread local provided by Routes, you can configure Routes
+ to use it::
from routes import request_config()
config = request_config()
@@ -115,16 +116,17 @@ def request_config(original=False):
config.request_local = YourLocalCallable
config = request_config()
- Once you have configured request_config, its advisable you retrieve it again to get the
- object you wanted. The variable you assign to request_local is assumed to be a callable
- that will get the local config object you wish.
+ Once you have configured request_config, its advisable you retrieve it
+ again to get the object you wanted. The variable you assign to
+ request_local is assumed to be a callable that will get the local config
+ object you wish.
- This example tests for the presence of the 'using_request_local' attribute which will be
- present if you haven't assigned it yet. This way you can avoid repeat assignments of the
- request specific callable.
+ This example tests for the presence of the 'using_request_local' attribute
+ which will be present if you haven't assigned it yet. This way you can
+ avoid repeat assignments of the request specific callable.
- Should you want the original object, perhaps to change the callable its using or stop
- this behavior, call request_config(original=True).
+ Should you want the original object, perhaps to change the callable its
+ using or stop this behavior, call request_config(original=True).
"""
obj = _RequestConfig()
try: