(self)
return '\n'.join(contents_raw)
Get the contents of :attr:`main_sources_list`.

        :returns: A Unicode string.

        This code currently assumes that the ``sources.list`` file is encoded
        using :data:`SOURCES_LIST_ENCODING`. I'm not actually sure if this is
        correct because I haven't been able to find a formal specification!
        Feedback is welcome :-).
        This code strips [options] from sources.list, stores it in :attr:`get_sources_list_options`
Get the contents of :attr:`main_sources_list`.
Get the contents of : attr : main_sources_list .
def get_sources_list(self):
        """
        Get the contents of :attr:`main_sources_list`.

        :returns: A Unicode string.

        This code currently assumes that the ``sources.list`` file is encoded
        using :data:`SOURCES_LIST_ENCODING`. I'm not actually sure if this is
        correct because I haven't been able to find a formal specification!
        Feedback is welcome :-).
        This code strips [options] from sources.list, stores it in :attr:`get_sources_list_options`
        """
        contents = self.context.read_file(self.main_sources_list)
        contents = contents.decode(SOURCES_LIST_ENCODING)
        sources_list_options = {}
        contents_raw = []  # stripped contents without options
        for i, line in enumerate(contents.splitlines()):
            if line.find('[') > 0:  # found '[' and not starts with '['
                startswith_deb = line.split('[')[0]
                temp = line.split('[')[1]
                sources_list_options[i] = temp.split(']')[0]
                startswith_http = temp.split(']')[1]
                contents_raw.append(startswith_deb + startswith_http)
            elif line.find('[') == -1:  # not found
                contents_raw.append(line)
        self.get_sources_list_options = sources_list_options
        return '\n'.join(contents_raw)
def get_sources_list ( self ) : contents = self . context . read_file ( self . main_sources_list ) contents = contents . decode ( SOURCES_LIST_ENCODING ) sources_list_options = { } contents_raw = [ ] # stripped contents without options for i , line in enumerate ( contents . splitlines ( ) ) : if line . find ( '[' ) > 0 : # found '[' and not starts with '[' startswith_deb = line . split ( '[' ) [ 0 ] temp = line . split ( '[' ) [ 1 ] sources_list_options [ i ] = temp . split ( ']' ) [ 0 ] startswith_http = temp . split ( ']' ) [ 1 ] contents_raw . append ( startswith_deb + startswith_http ) elif line . find ( '[' ) == - 1 : # not found contents_raw . append ( line ) self . get_sources_list_options = sources_list_options return '\n' . join ( contents_raw )