[MERGE] tools.translate: add compatibility with Babel v.1.3, courtesy of Stefan Rijnhart (Therp)

lp bug: https://launchpad.net/bugs/1226576 fixed

bzr revid: odo@openerp.com-20130918081216-8dnkmyp4wif3nm24
This commit is contained in:
Olivier Dony 2013-09-18 10:12:16 +02:00
commit ff9e90fad6
1 changed files with 5 additions and 2 deletions

View File

@ -874,8 +874,11 @@ def trans_generate(lang, modules, cr):
if module:
src_file = open(fabsolutepath, 'r')
try:
for lineno, message, comments in extract.extract(extract_method, src_file,
keywords=extract_keywords):
for extracted in extract.extract(extract_method, src_file,
keywords=extract_keywords):
# Babel 0.9.6 yields lineno, message, comments
# Babel 1.3 yields lineno, message, comments, context
lineno, message, comments = extracted[:3]
push_translation(module, trans_type, display_path, lineno,
encode(message), comments + extra_comments)
except Exception: