diff options
author | Ben Bangert <ben@groovie.org> | 2011-10-16 10:31:53 -0700 |
---|---|---|
committer | Ben Bangert <ben@groovie.org> | 2011-10-16 10:31:53 -0700 |
commit | 3fb996e9ee529f7305569d423848c2c61ac3def7 (patch) | |
tree | 28b05f6a574cc075637f01aef911748ab4344c57 /routes/mapper.py | |
parent | 20cfad928c8dbae46e309f1e6150affd9d2b48c5 (diff) | |
parent | a1cb7151a4c06a9bbabad19283a58b43be2a63f2 (diff) | |
download | routes-3fb996e9ee529f7305569d423848c2c61ac3def7.tar.gz |
Merge
--HG--
branch : trunk
Diffstat (limited to 'routes/mapper.py')
-rw-r--r-- | routes/mapper.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/routes/mapper.py b/routes/mapper.py index 18ade09..9befa7d 100644 --- a/routes/mapper.py +++ b/routes/mapper.py @@ -3,8 +3,10 @@ import re import sys import threading +import pkg_resources +from repoze.lru import LRUCache + from routes import request_config -from routes.lru import LRUCache from routes.util import controller_scan, MatchException, RoutesException from routes.route import Route @@ -736,8 +738,9 @@ class Mapper(SubMapperParent): # Check the url cache to see if it exists, use it if it does for key in [cache_key, cache_key_script_name]: - if key in self.urlcache: - return self.urlcache[key] + val = self.urlcache.get(key, self) + if val != self: + return val actionlist = self._gendict.get(controller) or self._gendict.get('*', {}) if not actionlist and not args: @@ -832,7 +835,7 @@ class Mapper(SubMapperParent): else: key = cache_key if self.urlcache is not None: - self.urlcache[key] = str(path) + self.urlcache.put(key, str(path)) return str(path) else: continue |