def filter_sources():
    newsource = []
    for item in SOURCES_DATA:
        distro = item[1]
        if is_ubuntu(distro):
            if module_check.get_codename() in distro:
                newsource.append([item[0], module_check.get_codename(), item[2], item[3]])
        else:
            newsource.append(item)

    return newsource
    def process_data(self, data):
        global SOURCES_DATA
        self.processing = True
        try:
            SOURCES_DATA = self.server.getsource(os.getenv('LANG'), module_check.get_codename())
        except:
            self.error = True

        self.processing = False
    def process_data(self, data):
        self.processing = True
        try:
            title, locale, comment, source = data
            self.server.putsource(title, locale, comment, module_check.get_codename(), source)
        except:
            self.error = True

        self.processing = False
    COLUMN_ICON,
    COLUMN_NAME,
    COLUMN_DESC,
    COLUMN_DISPLAY,
) = range(5)

DEFAULT_SOURCE = '''deb http://archive.ubuntu.com/ubuntu/ %(distro)s main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ %(distro)s-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ %(distro)s-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ %(distro)s-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ %(distro)s-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ %(distro)s main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ %(distro)s-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ %(distro)s-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ %(distro)s-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ %(distro)s-backports main restricted universe multiverse''' % {'distro': module_check.get_codename()}

SOURCES_LIST = '/etc/apt/sources.list'
#SOURCES_LIST = '/home/tualatrix/Desktop/sources.list'

class SelectSourceDialog(gtk.Dialog):
    def __init__(self, parent):
        super(SelectSourceDialog, self).__init__(parent = parent)

        self.set_title(_('Choose the sources'))
        self.set_border_width(10)
        self.set_resizable(False)

        label = gtk.Label()
        label.set_markup('<b><big>%s</big></b>\n\n%s' % (_('Choose the sources'),
            _('You can read the title and comment to determine which source is suitable for you.')))