comparison frontends/src/wix/contact_list.py @ 316:3a21d586dae4

wix: workaround a weird bug which crash wix while using empty_avatar, see comments for more information
author Goffi <goffi@goffi.org>
date Mon, 02 May 2011 16:51:07 +0200
parents b1794cbb88e5
children 0806a65a5fa9
comparison
equal deleted inserted replaced
315:31804aa9d3da 316:3a21d586dae4
112 #show[0]==shortcut 112 #show[0]==shortcut
113 #show[1]==human readable 113 #show[1]==human readable
114 #show[2]==color (or None) 114 #show[2]==color (or None)
115 show_html = "<font color='%s'>[%s]</font>" % (show[2], show[1]) if show[2] else "" 115 show_html = "<font color='%s'>[%s]</font>" % (show[2], show[1]) if show[2] else ""
116 status = self.CM.getAttr(jid,'status') or '' 116 status = self.CM.getAttr(jid,'status') or ''
117 avatar = self.CM.getAttr(jid,'avatar') or IMAGE_DIR+'/empty_avatar.png' 117 avatar = self.CM.getAttr(jid,'avatar') or IMAGE_DIR+'/empty_avatar' #XXX: there is a weird bug here: if the image has an extension (i.e. empty_avatar.png),
118 #WxPython segfault, and it doesn't without nothing. I couldn't reproduce the case with a basic test script, so it need further investigation before reporting it
119 #to WxPython dev. Anyway, the program crash with a segfault, not a python exception, so there is definitely something wrong with WxPython.
120 #The case seems to happen when SimpleHtmlListBox parse the HTML with the <img> tag
118 121
119 html = """ 122 html = """
120 <table border='0'> 123 <table border='0'>
121 <td> 124 <td>
122 <img height='64' width='64' src='%s' /> 125 <img height='64' width='64' src='%s' />
148 gp_idx = 0 151 gp_idx = 0
149 if not indexes: #this is a new group, we have to create it 152 if not indexes: #this is a new group, we have to create it
150 gp_idx = self.Append(self.__presentGroup(group), Group(group)) 153 gp_idx = self.Append(self.__presentGroup(group), Group(group))
151 else: 154 else:
152 gp_idx = indexes[0] 155 gp_idx = indexes[0]
153 156
154 self.Insert(self.__presentItem(contact), gp_idx+1, contact) 157 self.Insert(self.__presentItem(contact), gp_idx+1, contact)
155 158
156 159
157 160
158 def remove(self, contact): 161 def remove(self, contact):