Skip to content
Snippets Groups Projects
Commit bc96e88d authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

merge

parents 58015a37 922ca0cf
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -130,4 +130,5 @@ class NetworkIncomingEvent(NetworkEvent): ...@@ -130,4 +130,5 @@ class NetworkIncomingEvent(NetworkEvent):
class NetworkOutgoingEvent(NetworkEvent): class NetworkOutgoingEvent(NetworkEvent):
pass pass
\ No newline at end of file
...@@ -486,6 +486,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler): ...@@ -486,6 +486,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
return tag return tag
def _get_img(self, attrs): def _get_img(self, attrs):
'''Download an image. This function is launched in a separate thread.
'''
mem, alt = '', '' mem, alt = '', ''
# Wait maximum 5s for connection # Wait maximum 5s for connection
socket.setdefaulttimeout(5) socket.setdefaulttimeout(5)
...@@ -538,6 +540,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler): ...@@ -538,6 +540,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
return (mem, alt) return (mem, alt)
def _update_img(self, (mem, alt), attrs, img_mark): 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)) self._process_img(attrs, (mem, alt, img_mark))
def _process_img(self, attrs, loaded=None): def _process_img(self, attrs, loaded=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment