aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/translate.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2013-04-25 14:16:17 +0200
committerElrond <elrond+mediagoblin.org@samba-tng.org>2013-04-25 14:31:29 +0200
commit5ae0cbaa551ca1457bb9b84ccad72836db1bf5fc (patch)
tree9b40dbe8c4f9be2ab96636eb8394ab5d8da4e2b4 /mediagoblin/tools/translate.py
parentc47be4b8bad385772c9926d2219f347628f60045 (diff)
downloadmediagoblin-5ae0cbaa551ca1457bb9b84ccad72836db1bf5fc.tar.lz
mediagoblin-5ae0cbaa551ca1457bb9b84ccad72836db1bf5fc.tar.xz
mediagoblin-5ae0cbaa551ca1457bb9b84ccad72836db1bf5fc.zip
No lazy_* needed here; Add ReallyLazyProxy.__repr__.
One should use lazy_* only if you have a good reason. This one found by our unit tests! For example add_message adds the message to the session, the session needs to be serialized (with json) and well, LazyProxy is not serializable. To aid in debugging, gave our ReallyLazyProxy a __repr__.
Diffstat (limited to 'mediagoblin/tools/translate.py')
-rw-r--r--mediagoblin/tools/translate.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mediagoblin/tools/translate.py b/mediagoblin/tools/translate.py
index 00677863..b20e57d1 100644
--- a/mediagoblin/tools/translate.py
+++ b/mediagoblin/tools/translate.py
@@ -50,6 +50,13 @@ class ReallyLazyProxy(LazyProxy):
def value(self):
return self._func(*self._args, **self._kwargs)
+ def __repr__(self):
+ return "<%s for %s(%r, %r)>" % (
+ self.__class__.__name__,
+ self._func,
+ self._args,
+ self._kwargs)
+
def locale_to_lower_upper(locale):
"""