der, expiretime, not timeout
diff --git a/lib/mako/codegen.py b/lib/mako/codegen.py index 0496614..7396769 100644 --- a/lib/mako/codegen.py +++ b/lib/mako/codegen.py
@@ -345,10 +345,10 @@ cachekey = node_or_pagetag.parsed_attributes.get('cache_key', repr(name)) cacheargs = {} print node_or_pagetag - for arg in (('cache_type', 'type'), ('cache_dir', 'data_dir'), ('cache_timeout', 'timeout')): + for arg in (('cache_type', 'type'), ('cache_dir', 'data_dir'), ('cache_timeout', 'expiretime')): val = node_or_pagetag.parsed_attributes.get(arg[0], None) if val is not None: - if arg[1] == 'timeout': + if arg[1] == 'expiretime': cacheargs[arg[1]] = int(eval(val)) else: cacheargs[arg[1]] = val @@ -356,7 +356,7 @@ if self.compiler.pagetag is not None: val = self.compiler.pagetag.parsed_attributes.get(arg[0], None) if val is not None: - if arg[1] == 'timeout': + if arg[1] == 'expiretime': cacheargs[arg[1]] == int(eval(val)) else: cacheargs[arg[1]] = val
diff --git a/test/cache.py b/test/cache.py index de53743..dd5a5fd 100644 --- a/test/cache.py +++ b/test/cache.py
@@ -154,8 +154,7 @@ """) m = self._install_mock_cache(t) t.render() - assert m.kwargs == {'data_dir':'./test_htdocs', 'type':'file', 'timeout':30} - + assert m.kwargs == {'data_dir':'./test_htdocs', 'type':'file', 'expiretime':30} t2 = Template(""" <%page cached="True" cache_timeout="30" cache_dir="./test_htdocs" cache_type="file" cache_key='somekey'/> @@ -163,7 +162,7 @@ """) m = self._install_mock_cache(t2) t2.render() - assert m.kwargs == {'data_dir':'./test_htdocs', 'type':'file', 'timeout':30} + assert m.kwargs == {'data_dir':'./test_htdocs', 'type':'file', 'expiretime':30} def test_fileargs_lookup(self): l = lookup.TemplateLookup(cache_dir='./test_htdocs', cache_type='file')