Ejemplo n.º 1
0
    def update_ppa_model(self):
        self.set_busy()
        self.__column.set_title('PPA Sources')
        model = self.get_model()
        model.clear()
        self.mode = 'ppa'

        ppa_source_dict = get_ppa_source_dict()

        for source in self.get_sourceslist():
            if ppa.is_ppa(source.uri) and source.type == 'deb' and not source.disabled:
                try:
                    id = ppa_source_dict[source.uri]
                    pixbuf = get_source_logo_from_filename(SOURCE_PARSER[id]['logo'])
                    name = SOURCE_PARSER.get_name(id)
                    comment = SOURCE_PARSER.get_summary(id)
                except:
                    id = source.uri
                    name = ppa.get_short_name(source.uri)
                    comment = ppa.get_homepage(source.uri)
                    pixbuf = get_source_logo_from_filename('')

                self.total_num += 1
                iter = model.append()
                log.debug("Found an enalbed PPA: %s" % name)
                model.set(iter,
                       COLUMN_ICON, pixbuf,
                       COLUMN_CHECK, False,
                       COLUMN_NAME, str(id),
                       COLUMN_DESC, '',
                       COLUMN_DISPLAY, '<b>%s</b>\n%s' % (name, comment),
                    )
        self.unset_busy()
Ejemplo n.º 2
0
    def update_ppa_model(self):
        self.set_busy()
        self.__column.set_title('PPA Sources')
        model = self.get_model()
        model.clear()
        self.mode = 'ppa'

        ppa_source_dict = get_ppa_source_dict()

        for source in self.get_sourceslist():
            if ppa.is_ppa(source.uri
                          ) and source.type == 'deb' and not source.disabled:
                try:
                    id = ppa_source_dict[source.uri]
                    pixbuf = get_source_logo_from_filename(
                        SOURCE_PARSER[id]['logo'])
                    name = SOURCE_PARSER.get_name(id)
                    comment = SOURCE_PARSER.get_summary(id)
                except:
                    id = source.uri
                    name = ppa.get_short_name(source.uri)
                    comment = ppa.get_homepage(source.uri)
                    pixbuf = get_source_logo_from_filename('')

                self.total_num += 1
                iter = model.append()
                log.debug("Found an enalbed PPA: %s" % name)
                model.set(
                    iter,
                    COLUMN_ICON,
                    pixbuf,
                    COLUMN_CHECK,
                    False,
                    COLUMN_NAME,
                    str(id),
                    COLUMN_DESC,
                    '',
                    COLUMN_DISPLAY,
                    '<b>%s</b>\n%s' % (name, comment),
                )
        self.unset_busy()