comparison src/browser/sat_browser/libervia_widget.py @ 694:82123705474b

massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions
author souliane <souliane@mailoo.org>
date Thu, 16 Apr 2015 14:57:02 +0200
parents 9877607c719a
children b395d1309936
comparison
equal deleted inserted replaced
693:1d60fa4d25a4 694:82123705474b
163 try: 163 try:
164 item, item_type = dt.getData("text/plain").split('\n') # Workaround for webkit, only text/plain seems to be managed 164 item, item_type = dt.getData("text/plain").split('\n') # Workaround for webkit, only text/plain seems to be managed
165 if item_type and item_type[-1] == '\0': # Workaround for what looks like a pyjamas bug: the \0 should not be there, and 165 if item_type and item_type[-1] == '\0': # Workaround for what looks like a pyjamas bug: the \0 should not be there, and
166 item_type = item_type[:-1] # .strip('\0') and .replace('\0','') don't work. TODO: check this and fill a bug report 166 item_type = item_type[:-1] # .strip('\0') and .replace('\0','') don't work. TODO: check this and fill a bug report
167 # item_type = dt.getData("type") 167 # item_type = dt.getData("type")
168 log.debug("message: %s" % item) 168 log.debug(u"message: %s" % item)
169 log.debug("type: %s" % item_type) 169 log.debug(u"type: %s" % item_type)
170 except: 170 except:
171 log.debug("no message found") 171 log.debug("no message found")
172 item = '&nbsp;' 172 item = '&nbsp;'
173 item_type = None 173 item_type = None
174 if item_type == "WIDGET": 174 if item_type == "WIDGET":
288 try: 288 try:
289 item, item_type = dt.getData("text/plain").split('\n') # Workaround for webkit, only text/plain seems to be managed 289 item, item_type = dt.getData("text/plain").split('\n') # Workaround for webkit, only text/plain seems to be managed
290 if item_type and item_type[-1] == '\0': # Workaround for what looks like a pyjamas bug: the \0 should not be there, and 290 if item_type and item_type[-1] == '\0': # Workaround for what looks like a pyjamas bug: the \0 should not be there, and
291 item_type = item_type[:-1] # .strip('\0') and .replace('\0','') don't work. TODO: check this and fill a bug report 291 item_type = item_type[:-1] # .strip('\0') and .replace('\0','') don't work. TODO: check this and fill a bug report
292 # item_type = dt.getData("type") 292 # item_type = dt.getData("type")
293 log.debug("message: %s" % item) 293 log.debug(u"message: %s" % item)
294 log.debug("type: %s" % item_type) 294 log.debug(u"type: %s" % item_type)
295 except: 295 except:
296 log.debug("no message found") 296 log.debug("no message found")
297 item = '&nbsp;' 297 item = '&nbsp;'
298 item_type = None 298 item_type = None
299 299
616 def isLocked(self): 616 def isLocked(self):
617 return self.locked 617 return self.locked
618 618
619 def changeWidget(self, row, col, wid): 619 def changeWidget(self, row, col, wid):
620 """Change the widget in the given location, add row or columns when necessary""" 620 """Change the widget in the given location, add row or columns when necessary"""
621 log.debug("changing widget: %s %s %s" % (wid.getDebugName(), row, col)) 621 log.debug(u"changing widget: %s %s %s" % (wid.getDebugName(), row, col))
622 last_row = max(0, self.flextable.getRowCount() - 1) 622 last_row = max(0, self.flextable.getRowCount() - 1)
623 # try: # FIXME: except without exception specified ! 623 # try: # FIXME: except without exception specified !
624 prev_wid = self.flextable.getWidget(row, col) 624 prev_wid = self.flextable.getWidget(row, col)
625 # except: 625 # except:
626 # log.error("Trying to change an unexisting widget !") 626 # log.error("Trying to change an unexisting widget !")
679 cellFormatter.setColSpan(last_row, 0, self._max_cols) 679 cellFormatter.setColSpan(last_row, 0, self._max_cols)
680 680
681 def addWidget(self, wid): 681 def addWidget(self, wid):
682 """Add a widget to a new cell on the next to last row""" 682 """Add a widget to a new cell on the next to last row"""
683 last_row = max(0, self.flextable.getRowCount() - 1) 683 last_row = max(0, self.flextable.getRowCount() - 1)
684 log.debug("putting widget %s at %d, %d" % (wid.getDebugName(), last_row, 0)) 684 log.debug(u"putting widget %s at %d, %d" % (wid.getDebugName(), last_row, 0))
685 self.changeWidget(last_row, 0, wid) 685 self.changeWidget(last_row, 0, wid)
686 686
687 def removeWidget(self, wid): 687 def removeWidget(self, wid):
688 """Remove a widget and the cell where it is""" 688 """Remove a widget and the cell where it is"""
689 _row, _col = self.flextable.getIndex(wid) 689 _row, _col = self.flextable.getIndex(wid)