Skip to content
Browse files

fixed babel entry point

--HG--
branch : trunk
  • Loading branch information...
1 parent e25f24d commit 7962ce70333745a277cc001123b385003f49c7b3 @mitsuhiko committed
Showing with 17 additions and 1 deletion.
  1. +16 −0 jinja2/utils.py
  2. +1 −1 setup.py
View
16 jinja2/utils.py
@@ -364,7 +364,9 @@ def __init__(self, capacity):
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 @@ def _remove(self, obj):
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)
View
2 setup.py
@@ -133,6 +133,6 @@ def _unavailable(self):
extras_require={'i18n': ['Babel>=0.8']},
entry_points="""
[babel.extractors]
- jinja2 = jinja.ext:babel_extract[i18n]
+ jinja2 = jinja2.ext:babel_extract[i18n]
"""
)

0 comments on commit 7962ce7

Please sign in to comment.
Something went wrong with that request. Please try again.