Comment functions added by [77d3b4e65b26]

This commit is contained in:
Julien Pivotto 2011-03-24 14:47:54 +01:00
parent 23677636f7
commit da05438598
1 changed files with 4 additions and 0 deletions

View File

@ -486,6 +486,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
return tag
def _get_img(self, attrs):
'''Download an image. This function is launched in a separate thread.
'''
mem, alt = '', ''
# Wait maximum 5s for connection
socket.setdefaulttimeout(5)
@ -538,6 +540,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
return (mem, alt)
def _update_img(self, (mem, alt), attrs, img_mark):
'''Callback function called after the function _get_img above.
'''
self._process_img(attrs, (mem, alt, img_mark))
def _process_img(self, attrs, loaded=None):