示例#1
0
 def fill_table_with_accounts(self, accounts):
     iconset = app.config.get('iconset')
     if not iconset:
         iconset = 'dcraven'
     file_path = os.path.join(helpers.get_iconset_path(iconset), '16x16')
     for acct in accounts:
         message = acct['message']
         message = helpers.reduce_chars_newlines(message, 100, 1)
         message = GLib.markup_escape_text(message)
         if acct['name'] in app.con_types and \
                 app.con_types[acct['name']] in ('tls', 'ssl'):
             show_lock = True
         else:
             show_lock = False
         if message:
             self.add_status_row(file_path,
                                 acct['show'],
                                 GLib.markup_escape_text(acct['name']) +
                                 ' - ' + message,
                                 show_lock=show_lock,
                                 indent=False)
         else:
             self.add_status_row(file_path,
                                 acct['show'],
                                 GLib.markup_escape_text(acct['name']),
                                 show_lock=show_lock,
                                 indent=False)
         for line in acct['event_lines']:
             self.add_text_row('  ' + line, 1)
示例#2
0
 def get_status_info(self, resource, priority, show, status):
     str_status = resource + ' (' + str(priority) + ')'
     if status:
         status = status.strip()
         if status != '':
             # reduce to 100 chars, 1 line
             status = helpers.reduce_chars_newlines(status, 100, 1)
             str_status = GLib.markup_escape_text(str_status)
             status = GLib.markup_escape_text(status)
             str_status += ' - <i>' + status + '</i>'
     return str_status
示例#3
0
    def fill_table_with_accounts(self, accounts):
        for acct in accounts:
            message = acct['message']
            message = helpers.reduce_chars_newlines(message, 100, 1)
            message = GLib.markup_escape_text(message)

            account_label = GLib.markup_escape_text(acct['account_label'])
            if message:
                status = '%s - %s' % (account_label, message)
            else:
                status = account_label

            self.add_status_row(acct['show'], status, indent=False)

            for line in acct['event_lines']:
                self.add_text_row('  ' + line, 1)