[ADD] support for zipped reports (code=zlib/reportgz config key) in report downloader

bzr revid: xmo@openerp.com-20110907072818-9ondrxh0q2j0yo7d
This commit is contained in:
Xavier Morel 2011-09-07 09:28:18 +02:00
parent 0b17356d23
commit 2a3cb44782
1 changed files with 3 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import simplejson
import textwrap
import xmlrpclib
import time
import zlib
import webrelease
from xml.etree import ElementTree
from cStringIO import StringIO
@ -1357,6 +1358,8 @@ class Reports(View):
time.sleep(self.POLLING_DELAY)
report = base64.b64decode(report_struct['result'])
if report_struct.get('code') == 'zlib':
report = zlib.decompress(report)
report_mimetype = self.TYPES_MAPPING.get(
report_struct['format'], 'octet-stream')
return req.make_response(report,