(self)
| 88 | self.type = self.NORMAL |
| 89 | |
| 90 | def defaultLabel(self): |
| 91 | queryreturn = None |
| 92 | retval = None |
| 93 | if self.type in (AccountMixin.NORMAL, AccountMixin.CHAN, AccountMixin.MAILINGLIST): |
| 94 | try: |
| 95 | retval = unicode(BMConfigParser().get(self.address, 'label'), 'utf-8') |
| 96 | except Exception as e: |
| 97 | queryreturn = sqlQuery( |
| 98 | '''select label from addressbook where address=?''', self.address) |
| 99 | elif self.type == AccountMixin.SUBSCRIPTION: |
| 100 | queryreturn = sqlQuery( |
| 101 | '''select label from subscriptions where address=?''', self.address) |
| 102 | if queryreturn is not None: |
| 103 | if queryreturn != []: |
| 104 | for row in queryreturn: |
| 105 | retval, = row |
| 106 | retval = unicode(retval, 'utf-8') |
| 107 | elif self.address is None or self.type == AccountMixin.ALL: |
| 108 | return unicode( |
| 109 | str(_translate("MainWindow", "All accounts")), 'utf-8') |
| 110 | if retval is None: |
| 111 | return unicode(self.address, 'utf-8') |
| 112 | else: |
| 113 | return retval |
| 114 | |
| 115 | |
| 116 | class Ui_FolderWidget(QtGui.QTreeWidgetItem, AccountMixin): |
no test coverage detected