| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Failed py34 syntax validation.
|
| |
|
| |
|
|
|
|
|
| |
When reading the docs I discovered a missing set of single quotes in
this code example which makes the example invalid python code. Fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the following review:
https://github.com/bbangert/routes/commit/0a417004be7e2d950bdcd629ccf24cf9f56ef817
Routes 2.3 has changed the function signature to mandate
path in addition to routename for the connect method.
In this patch, we try to get back to path being optional by
checking the length of the args list. No other change in
logic.
This hopefully fixes the problem reported here:
https://github.com/bbangert/routes/issues/64
Add an entry in Changelog as well.
|
|
|
|
|
| |
Problem occurred when new subdomain was left substring of current one.
In this case subdomain was not replaced.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When python3 is run with -bb, str(bytes) raises a BytesWarning. On
Python 3, Mapper.generate() gets such BytesWarning because
script_name type is str whereas cache_key type is byte.
On Python 3, generate() now encodes the script_name to UTF-8 and uses
bytes concatenation to fix this issue.
.travis.yml: Run tests using "python -bb $(which nosetests)" to raise
BytesWarning exception on bytes vs Unicode issue.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for ``requirements`` option to mapper.resource,
which makes it possible to restrict matching in urls (most often
useful for capturing variables with path_prefix).
In OpenStack Nova we've used the prefix_path on Mapper.resource to
specify additional variables we want to capture (specifically
{project_id}). Project_id is a uuid. When trying to restrict
project_id to only valid uuid format a couple of issues were exposed.
- #1 '/{project_id:[a-f0-9]{32}}/...' builds an incorrect regex
because of the nested {}
- #2 the preferred method that works on connect() to pass
requirements doesn't work here (requirements are reset to only an
id match)
That leaves us with having to build a custom project_id match with 32
[a-f0-9] strings appended for every resource added to get the support
we need without effectively vendoring our own version of Mapper.resource.
This small change to allow requirements to pass through would make it
possible to get this tighter validation with much smaller regexes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow name_prefixes to concatenate in submapper nesting. Also fix the
case where the concatenation behavior was being applied to all
non-dictionary arguments in the submapper. This had the effect of
concat'ing args like controller definition together rather than allowing
submapper definitions to override parent definitions for arguments.
Fix mapper so that collection_name can be None.
For collections with no collection_name, adds a logic branch to handle
the case cleanly and provide a reasonable path_prefix.
Remove special controller case
This change makes routes treat path_prefix and name_prefix as special
instead of 'controller' as special. This allows any argument to be
overridden in child submappers and allows the 'prefix' args to
concatenate as you would expect.
Add extended call signature to add_action, missing from previous commits
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code now works on Python 2 and Python 3 without modifications: 2to3
is no more needed. Changes:
* Drop 2to3 from setup.py: the code is now directly compatible with
Python 2 and Python 3
* Add dependency to six
* Drop support for Python 3.2: remove 3.2 from .travis.yml
* Replace "for key, value in dict.iteritems():" with "for key, value in
six.iteritems(dict):"
* Use six.moves.urllib to get urllib functions
* Replace unicode() with six.text_type()
* Replace dict.keys() with list(dict.keys())
* Replace "dict.has_key(key)" with "key in dict"
* Remove "py3where=build" from notests section of setup.cfg
* Add parenthesis to print()
* Replace dict.items() with list(dict.items())
|
|
|
|
| |
optional sections to avoid exceeding regex limits. Fixes #15.
|
|
|
|
| |
route. Fixes #11.
|
|
|
|
|
| |
'anchor'. They can now be passed in with a trailing '_' as was possible
before commit d1d1742903fa5ca24ef848a6ae895303f2661b2a. Fixes #7.
|
|
|
|
|
|
| |
failing to return the appropriate cached URL generation. The URL cache
should always include the SCRIPT_NAME, even if its empty, in the cache
to avoid this, and now does. Fixes #6.
|
| |
|
|
|
|
| |
path. Fixes #5.
|
| |
|
|
|
|
| |
Allow a Mapper subclass to use a different Route implementation.
|
|\
| |
| | |
Allow for a large number of URL matches
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently routes/regex raises an OverflowError when compiling a master
list of 'valid' URLs if the number of controllers/routes is extremely
high. This error can be worked around by assuming all URLs are good
until all matches have been tested.
This means that on large projects performance will be slightly
increased with valid requests and slightly decreased with invalid
requests.
|
|/ |
|
|\
| |
| | |
Small misprint fix in collection() docs
|
| | |
|
| | |
|
|/ |
|
|\
| |
| |
| |
| | |
--HG--
branch : trunk
|
| |
| |
| |
| |
| | |
--HG--
branch : trunk
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Added to regex to allow excaped dots in urls
* Added tests to make sure escaped dots work and
dont clobber the existing format strings
--HG--
branch : trunk
|
|/
|
|
|
| |
--HG--
branch : e2.0
|
|
|
|
|
|
|
| |
URL's and the singleton is not present.
--HG--
branch : trunk
|
|
|
|
|
| |
--HG--
branch : trunk
|
|
|
|
|
| |
--HG--
branch : trunk
|
|
|
|
|
| |
--HG--
branch : trunk
|
|
|
|
|
|
|
| |
including the appropriate slash. Fixes #13.
--HG--
branch : trunk
|
|
|
|
|
|
|
| |
Fixes #24.
--HG--
branch : trunk
|
|
|
|
|
|
|
| |
* Return explicit to being default to True.
--HG--
branch : trunk
|
|
|
|
|
| |
--HG--
branch : trunk
|
|
|
|
|
|
|
| |
doesn't break url_for users.
--HG--
branch : trunk
|
|
|
|
|
| |
--HG--
branch : trunk
|
|\
| |
| |
| |
| | |
--HG--
branch : trunk
|
| |
| |
| |
| |
| | |
--HG--
branch : trunk
|
| |
| |
| |
| |
| |
| |
| | |
generating separate "formatted routes"
--HG--
branch : trunk
|
| |
| |
| |
| |
| | |
--HG--
branch : trunk
|
| |
| |
| |
| |
| | |
--HG--
branch : trunk
|
| |
| |
| |
| |
| | |
--HG--
branch : trunk
|
| |
| |
| |
| |
| | |
--HG--
branch : trunk
|