+ def handle_image(self, attrs):
+ alt = u''
+ url = u''
+ for attr in attrs:
+ if attr[0] == 'alt':
+ alt = attr[1].decode('utf-8')
+ elif attr[0] == 'src':
+ url = attr[1].decode('utf-8')
+ if url:
+ if alt:
+ if self.images.has_key(alt):
+ if self.images[alt]["url"] == url:
+ self.curdata = self.curdata \
+ + u'|%s|' %(alt,)
+ else:
+ while self.images.has_key(alt):
+ alt = alt + "_"
+ self.images[alt] = {"url": url}
+ self.curdata = self.curdata \
+ + u'|%s|' %(alt,)
+ else:
+ self.images[alt] = {"url": url}
+ self.curdata = self.curdata \
+ + u'|%s|' %(alt,)
+ else:
+ if self.images.has_key(url):
+ self.curdata = self.curdata \
+ + u'|%s|' %(url,)
+ else:
+ self.images[url] = {}
+ self.images[url]["url"] =url
+ self.curdata = self.curdata \
+ + u'|%s|' %(url,)
+