1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##############################################################################
22 # Why doing some multi-thread instead of using OSE capabilities ?
26 # Add a transparant multi-thread layer to all report rendering layers
32 # TODO: method to stock on the disk
33 # Les class de reporting doivent surclasser cette classe
34 # Les seules methodes qui peuvent etre redefinies sont:
39 """ Represents a report job being rendered.
41 @param bin_datas a dictionary of name:<binary content> of images etc.
42 @param path the path in which binary files can be discovered, useful
43 for components (images) of the report. It can be:
44 - a string, relative or absolute path to images
45 - a list, containing strings of paths.
46 If a string is absolute path, it will be opened as such, else
47 it will be passed to tools.file_open() which also considers zip
50 def __init__(self, bin_datas=None, path='.'):
55 self.bin_datas = bin_datas
63 result = self._render()
78 if __name__=='__main__':
80 print 'Multi-thread code !'
83 while not r.is_done():
89 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: