diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-03-18 17:25:16 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-03-18 17:25:16 +0100 |
commit | 8d5ffbe5f1b6ea9e9679feadc7c413426ac724a5 (patch) | |
tree | 70be9d66b68a349bb386e75ad65521cee24c924a | |
parent | f863227e7881492e14b5361f6cccdc857210f64f (diff) | |
download | paste-git-8d5ffbe5f1b6ea9e9679feadc7c413426ac724a5.tar.gz |
URLMap: add missing abstract __len__ and __iter__ methods
-rw-r--r-- | paste/urlmap.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/paste/urlmap.py b/paste/urlmap.py index 8b9a7c3..59b0336 100644 --- a/paste/urlmap.py +++ b/paste/urlmap.py @@ -96,6 +96,13 @@ class URLMap(DictMixin): not_found_app = self.not_found_app self.not_found_application = not_found_app + def __len__(self): + return len(self.applications) + + def __iter__(self): + for app_url, app in self.applications: + yield app_url + norm_url_re = re.compile('//+') domain_url_re = re.compile('^(http|https)://') |