diff options
author | ianb <devnull@localhost> | 2006-07-11 15:47:33 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-07-11 15:47:33 +0000 |
commit | 0bfa6589c77986da06532f7be42ae97cbad71a38 (patch) | |
tree | e9a5c5ae6770634534e4fa543f98d9a19043bcd9 /paste/url.py | |
parent | 9fbe95205d4a9d5ee875ce16c7ffd8ce4fb0b94d (diff) | |
download | paste-0bfa6589c77986da06532f7be42ae97cbad71a38.tar.gz |
Added a setvars method, to complement setvar/var
Diffstat (limited to 'paste/url.py')
-rw-r--r-- | paste/url.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/paste/url.py b/paste/url.py index e4bae0d..afc4fca 100644 --- a/paste/url.py +++ b/paste/url.py @@ -163,6 +163,15 @@ class URLResource(object): attrs=self.attrs, params=self.original_params) + def setvars(self, **kw): + """ + Creates a copy of this URL, but with all the variables set/reset + (like .setvar(), except clears past variables at the same time) + """ + return self.__class__(self.url, vars=kw.items(), + attrs=self.attrs, + params=self.original_params) + def addpath(self, *paths): u = self for path in paths: |