diff options
author | Marcel Hellkamp <marc@gsites.de> | 2015-12-07 13:57:22 +0100 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2015-12-07 13:57:22 +0100 |
commit | d2127e0a35f30b30a72eec1468be82faa6f004b4 (patch) | |
tree | 62b639bbfab2e3c6dbe0dcc3c6aeee957703b1e9 | |
parent | e456b4fe389c6410db5c1a813d2991e9f65688ee (diff) | |
download | bottle-d2127e0a35f30b30a72eec1468be82faa6f004b4.tar.gz |
Deprecating the old route syntax.
-rw-r--r-- | bottle.py | 3 | ||||
-rwxr-xr-x | docs/tutorial.rst | 19 |
2 files changed, 4 insertions, 18 deletions
@@ -390,6 +390,9 @@ class Router(object): for match in self.rule_syntax.finditer(rule): prefix += rule[offset:match.start()] g = match.groups() + if g[2] is not None: + depr(0, 13, "Use of old route syntax.", + "Use <name> instead of :name in routes.") if len(g[0]) % 2: # Escaped wildcard prefix += match.group(0)[len(g[0]):] offset = match.end() diff --git a/docs/tutorial.rst b/docs/tutorial.rst index bea0f6d..6c0140f 100755 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -147,9 +147,7 @@ Each wildcard passes the covered part of the URL as a keyword argument to the re def user_api(action, user): ... -.. versionadded:: 0.10 - -Filters are used to define more specific wildcards, and/or transform the covered part of the URL before it is passed to the callback. A filtered wildcard is declared as ``<name:filter>`` or ``<name:filter:config>``. The syntax for the optional config part depends on the filter used. +Filters can be used to define more specific wildcards, and/or transform the covered part of the URL before it is passed to the callback. A filtered wildcard is declared as ``<name:filter>`` or ``<name:filter:config>``. The syntax for the optional config part depends on the filter used. The following filters are implemented by default and more may be added: @@ -174,21 +172,6 @@ Let's have a look at some practical examples:: You can add your own filters as well. See :doc:`routing` for details. -.. versionchanged:: 0.10 - -The new rule syntax was introduced in **Bottle 0.10** to simplify some common use cases, but the old syntax still works and you can find a lot of code examples still using it. The differences are best described by example: - -=================== ==================== -Old Syntax New Syntax -=================== ==================== -``:name`` ``<name>`` -``:name#regexp#`` ``<name:re:regexp>`` -``:#regexp#`` ``<:re:regexp>`` -``:##`` ``<:re>`` -=================== ==================== - -Try to avoid the old syntax in future projects if you can. It is not currently deprecated, but will be eventually. - HTTP Request Methods ------------------------------------------------------------------------------ |