From df8dc27e54ce91b5ab84358b06c3fedd0032440a Mon Sep 17 00:00:00 2001 From: Mike Bayer <mike_mp@zzzcomputing.com> Date: Mon, 16 Jun 2008 19:18:40 +0000 Subject: [PATCH] - bumped magic number, which forces template recompile for this version (fixes incompatible compile symbols from 0.1 series). - added a few docs for cache options, specifically those that help with memcached. --- CHANGES | 7 ++++++- doc/build/content/caching.txt | 4 +++- lib/mako/codegen.py | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 8af6d3a..801fed8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ 0.2.1 - fixed bug where 'output_encoding' parameter would prevent -render_unicode() from returning a unicode object +render_unicode() from returning a unicode object. +- bumped magic number, which forces template recompile for +this version (fixes incompatible compile symbols from 0.1 +series). +- added a few docs for cache options, specifically those that +help with memcached. 0.2.0 - Speed improvements (as though we needed them, but people diff --git a/doc/build/content/caching.txt b/doc/build/content/caching.txt index 113afd4..6599ce6 100644 --- a/doc/build/content/caching.txt +++ b/doc/build/content/caching.txt @@ -26,8 +26,10 @@ The options available are: * cached="False|True" - turn caching on * cache_timeout - number of seconds in which to invalidate the cached data. after this timeout, the content is re-generated on the next call. -* cache_type - type of caching. `memory`, `file`, `dbm`, or `memcached`. (TODO: describe extra arguments for memcached) +* cache_type - type of caching. `memory`, `file`, `dbm`, or `memcached`. +* cache_url - (only used for `memcached` but required) a single IP address or a semi-colon separated list of IP address of memcache servers to use. * cache_dir - In the case of the `file` and `dbm` cache types, this is the filesystem directory with which to store data files. If this option is not present, the value of `module_directory` is used (i.e. the directory where compiled template modules are stored). If neither option is available an exception is thrown. +In the case of the `memcached` type, this attribute is required and it's used to store the lock files. * cache_key - the "key" used to uniquely identify this content in the cache. the total namespace of keys within the cache is local to the current template, and the default value of "key" is the name of the def which is storing its data. It is an evaluable tag, so you can put a Python expression to calculate the value of the key on the fly. For example, heres a page that caches any page which inherits from it, based on the filename of the calling template: <%page cached="True" cache_key="${self.filename}"/> diff --git a/lib/mako/codegen.py b/lib/mako/codegen.py index 46dc502..a9255f1 100644 --- a/lib/mako/codegen.py +++ b/lib/mako/codegen.py @@ -11,7 +11,7 @@ import re from mako.pygen import PythonPrinter from mako import util, ast, parsetree, filters -MAGIC_NUMBER = 2 +MAGIC_NUMBER = 3 def compile(node, uri, filename=None, default_filters=None, buffer_filters=None, imports=None, source_encoding=None, generate_unicode=True): -- GitLab