Logo Search packages:      
Sourcecode: ubuntuone-installer version File versions  Download package

def ubuntuone::installer::gui::Window::__get_series (   self ) [private]
Get the series we're running on.

Definition at line 323 of file gui.py.

                          :
        """Get the series we're running on."""
        on_ubuntu = False
        series = None

        def get_value(keypair):
            return keypair.split('=')[1].strip()

        try:
            with open('/etc/lsb-release', 'r') as f:
                for line in f.readlines():
                    if line.startswith('DISTRIB_ID'):
                        on_ubuntu = get_value(line) == u'Ubuntu'
                    if line.startswith('DISTRIB_CODENAME'):
                        series = get_value(line)
            if not on_ubuntu or series is None:
                raise UnsupportedDistribution(
                    'This distribution is not supported by Ubuntu One.')
        except (OSError, IOError, UnsupportedDistribution), error:
            self.__got_error(error)

        return series


Generated by  Doxygen 1.6.0   Back to index