[jToolkit-cvs] jToolkit/widgets table.py,1.5,1.6
Brought to you by:
davidfraser,
friedelwolff
From: <dav...@us...> - 2004-03-08 17:15:12
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27211 Modified Files: table.py Log Message: Unicode problems sneak up on you in the unlikeliest of places ... apply the same fix used in getcontents to getrowcontents... (this probably makes it unneccessary in getcontents as well...) Index: table.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/table.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** table.py 9 Feb 2004 14:05:41 -0000 1.5 --- table.py 8 Mar 2004 16:50:45 -0000 1.6 *************** *** 113,122 **** def getrowcontents(self, rownum): ! htmlstring = "<tr>" ! for colnum in self.colrange(): ! cell = self.getcell(rownum, colnum) ! htmlstring += cell.gethtml() ! htmlstring += "</tr>\r" ! return htmlstring def getcontents(self): --- 113,124 ---- def getrowcontents(self, rownum): ! contentslist = [self.getcell(rownum, colnum).gethtml() for colnum in self.colrange()] ! # TODO: investigate ways to neaten this up while still preventing ASCII decoding error... ! typelist = [type(p) for p in contentslist] ! if unicode in typelist and str in typelist: ! for n in range(len(contentslist)): ! if type(contentslist[n]) == str: ! contentslist[n] = contentslist[n].decode('iso8859') ! return "<tr>" + "".join(contentslist) + "</tr>\r" def getcontents(self): |