chaged pickling rules for lazyT

This commit is contained in:
mdipierro
2013-08-29 18:57:52 -05:00
parent b82f46352d
commit ca0bbac685
2 changed files with 5 additions and 13 deletions

View File

@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.08.29.08.21.46
Version 2.6.0-development+timestamp.2013.08.29.18.56.54

View File

@@ -423,6 +423,10 @@ class lazyT(object):
return lazyT(self)
return lazyT(self.m, symbols, self.T, self.f, self.t, self.M)
def pickle_lazyT(c):
return str, (c.xml(),)
copy_reg.pickle(lazyT, pickle_lazyT)
class translator(object):
"""
@@ -926,18 +930,6 @@ def findT(path, language=DEFAULT_LANGUAGE):
else sentences['!langcode!'])
write_dict(lang_file, sentences)
### important to allow safe session.flash=T(....)
def lazyT_unpickle(data):
return marshal.loads(data)
def lazyT_pickle(data):
return lazyT_unpickle, (marshal.dumps(str(data)),)
copy_reg.pickle(lazyT, lazyT_pickle, lazyT_unpickle)
def update_all_languages(application_path):
path = pjoin(application_path, 'languages/')
for language in oslistdir(path):