[REF] openerp/report/render/render.py: removed silly main() method, rewrote french comment in english.

bzr revid: vmt@openerp.com-20110531152711-49kyo4xhtak3r874
This commit is contained in:
Vo Minh Thu 2011-05-31 17:27:11 +02:00
parent 89a7b72bf0
commit 358f6881f3
1 changed files with 6 additions and 22 deletions

View File

@ -26,15 +26,7 @@
# Add a transparant multi-thread layer to all report rendering layers
#
import threading
#
# TODO: method to stock on the disk
# Les class de reporting doivent surclasser cette classe
# Les seules methodes qui peuvent etre redefinies sont:
# __init__
# _render
#
class render(object):
""" Represents a report job being rendered.
@ -46,6 +38,10 @@ class render(object):
If a string is absolute path, it will be opened as such, else
it will be passed to tools.file_open() which also considers zip
addons.
Reporting classes must subclass this class and redefine the __init__ and
_render methods (not the other methods).
"""
def __init__(self, bin_datas=None, path='.'):
self.done = False
@ -60,14 +56,12 @@ class render(object):
def render(self):
self.done = False
result = self._render()
self._result = result
self._result = self._render()
self.done = True
return True
def is_done(self):
res = self.done
return res
return self.done
def get(self):
if self.is_done():
@ -75,16 +69,6 @@ class render(object):
else:
return None
if __name__=='__main__':
import time
print 'Multi-thread code !'
r = render()
r.render()
while not r.is_done():
print 'not yet!'
time.sleep(1)
print 'done!'
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: