From: Armin Ronacher Date: Tue, 20 May 2008 15:52:52 +0000 (+0200) Subject: fixed babel entry point X-Git-Tag: 2.0rc1~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7962ce70333745a277cc001123b385003f49c7b3;p=jinja2.git fixed babel entry point --HG-- branch : trunk --- diff --git a/jinja2/utils.py b/jinja2/utils.py index 529abd2..90eb737 100644 --- a/jinja2/utils.py +++ b/jinja2/utils.py @@ -364,7 +364,9 @@ class LRUCache(object): self.capacity = capacity self._mapping = {} self._queue = deque() + self._postinit() + def _postinit(self): # alias all queue methods for faster lookup self._popleft = self._queue.popleft self._pop = self._queue.pop @@ -380,6 +382,20 @@ class LRUCache(object): del self._queue[idx] break + def __getstate__(self): + return { + 'capacity': self.capacity, + '_mapping': self._mapping, + '_queue': self._queue + } + + def __setstate__(self, d): + self.__dict__.update(d) + self._postinit() + + def __getnewargs__(self): + return (self.capacity,) + def copy(self): """Return an shallow copy of the instance.""" rv = self.__class__(self.capacity) diff --git a/setup.py b/setup.py index 7fe263d..fd7d3f5 100644 --- a/setup.py +++ b/setup.py @@ -133,6 +133,6 @@ setup( extras_require={'i18n': ['Babel>=0.8']}, entry_points=""" [babel.extractors] - jinja2 = jinja.ext:babel_extract[i18n] + jinja2 = jinja2.ext:babel_extract[i18n] """ )