Source code for libka.kubuntu_ppa
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
# kate: space-indent on; indent-width 4; replace-tabs on; indent-mode python; remove-trailing-space modified;
# vim: expandtab ts=4
# pylint: enable=line-too-long
############################################################################
# Copyright © 2016-2018 José Manuel Santamaría Lema <panfaust@gmail.com> #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
############################################################################
"""This module just provides the `KubuntuPPA` class"""
from libka.ka_configuration import get_ka_config_parser
#Class to find out the ppa name from the release type
[docs]
class KubuntuPPA:
"""This class represents a Kubuntu PPA"""
def __init__(self, release_type):
ka_config = get_ka_config_parser()
if release_type == "frameworks":
self._full_name = ka_config['ppas']['frameworks-ppa']
elif release_type == "plasma":
self._full_name = ka_config['ppas']['plasma-ppa']
elif release_type == "applications":
self._full_name = ka_config['ppas']['applications-ppa']
elif release_type == "qt":
self._full_name = ka_config['ppas']['qt-ppa']
else:
self._full_name = ka_config['ppas']['other-ppa']
[docs]
def get_full_name(self):
"""Returns the full name string of the PPA."""
return self._full_name
[docs]
def get_user_name(self):
"""Returns the user name of the PPA."""
return self._full_name.split(':')[1].split('/')[0]
[docs]
def get_ppa_name(self):
"""Retuns the name of the PPA, removing the username from the beginning."""
return self._full_name.split(':')[1].split('/')[1]