summaryrefslogtreecommitdiff
path: root/routes/route.py
diff options
context:
space:
mode:
Diffstat (limited to 'routes/route.py')
-rw-r--r--routes/route.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/routes/route.py b/routes/route.py
index 860a911..3b04f42 100644
--- a/routes/route.py
+++ b/routes/route.py
@@ -148,13 +148,22 @@ class Route(object):
"""Utility function to walk the route, and pull out the valid
dynamic/wildcard keys."""
collecting = False
+ escaping = False
current = ''
done_on = ''
var_type = ''
just_started = False
routelist = []
for char in routepath:
- if char in [':', '*', '{'] and not collecting and not self.static \
+ if escaping:
+ if char in ['\\', ':', '*', '{', '}']:
+ current += char
+ else:
+ current += '\\' + char
+ escaping = False
+ elif char == '\\':
+ escaping = True
+ elif char in [':', '*', '{'] and not collecting and not self.static \
or char in ['{'] and not collecting:
just_started = True
collecting = True