summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2012-10-13 17:11:01 -0500
committerMichael Merickel <michael@merickel.org>2012-10-13 17:11:01 -0500
commit4b8cf2d4e9711189e800dcb470a29773e4269f92 (patch)
treec413121c0e0e30556dc09368cee07af1e749905b
parent5507b82bcf5e1b9d59216e72ea71a026b72cd255 (diff)
downloadpyramid-4b8cf2d4e9711189e800dcb470a29773e4269f92.tar.gz
pyramid-4b8cf2d4e9711189e800dcb470a29773e4269f92.tar.bz2
pyramid-4b8cf2d4e9711189e800dcb470a29773e4269f92.zip
updated request_param and match_param to use as_sorted_tuple
-rw-r--r--pyramid/config/predicates.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/pyramid/config/predicates.py b/pyramid/config/predicates.py
index 3a82e8f15..08299e4bd 100644
--- a/pyramid/config/predicates.py
+++ b/pyramid/config/predicates.py
@@ -64,10 +64,7 @@ class PathInfoPredicate(object):
class RequestParamPredicate(object):
def __init__(self, val, config):
- if not is_nonstr_iter(val):
- val = (val,)
- val = sorted(val)
- self.val = val
+ val = as_sorted_tuple(val)
reqs = []
for p in val:
k = p
@@ -76,6 +73,7 @@ class RequestParamPredicate(object):
k, v = p.split('=', 1)
k, v = k.strip(), v.strip()
reqs.append((k, v))
+ self.val = val
self.reqs = reqs
def text(self):
@@ -163,9 +161,7 @@ class RequestTypePredicate(object):
class MatchParamPredicate(object):
def __init__(self, val, config):
- if not is_nonstr_iter(val):
- val = (val,)
- val = sorted(val)
+ val = as_sorted_tuple(val)
self.val = val
reqs = [ p.split('=', 1) for p in val ]
self.reqs = [ (x.strip(), y.strip()) for x, y in reqs ]