diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-26 12:25:50 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-26 12:25:50 (GMT) |
commit | 102c54705debb1dc880b066c9d92261ee4ef6088 (patch) | |
tree | 38e2668c6339da4e678329ccf49b9b8d6330924d | |
parent | 5dcf454dacb1a104fea90735f9a0fa2d76854faf (diff) |
Add documentation for the distro specific classes
-rw-r--r-- | devbot/plugins/fedora.py | 5 | ||||
-rw-r--r-- | devbot/plugins/interfaces.py | 52 | ||||
-rw-r--r-- | devbot/plugins/ubuntu.py | 5 |
3 files changed, 58 insertions, 4 deletions
diff --git a/devbot/plugins/fedora.py b/devbot/plugins/fedora.py index cd0288d..d5dd814 100644 --- a/devbot/plugins/fedora.py +++ b/devbot/plugins/fedora.py @@ -3,8 +3,9 @@ import subprocess from devbot import command from devbot import distro +from devbot.plugins import interfaces -class PackageManager: +class PackageManager(interfaces.PackageManager): def __init__(self, test=False, interactive=True): self._test = test self._interactive = interactive @@ -80,7 +81,7 @@ class PackageManager: distro.register_package_manager("fedora", PackageManager) -class DistroInfo: +class DistroInfo(interfaces.DistroInfo): def __init__(self): self.use_lib64 = os.uname()[4] == "x86_64" diff --git a/devbot/plugins/interfaces.py b/devbot/plugins/interfaces.py new file mode 100644 index 0000000..955a317 --- /dev/null +++ b/devbot/plugins/interfaces.py @@ -0,0 +1,52 @@ +import os +import subprocess + +from devbot import command +from devbot import distro + +class PackageManager: + def install_packages(self, packages): + """Install packages + + :param packages: packages to install + """ + + def remove_packages(self, packages): + """Remove a list of packages + + :param packages: packages to remove + """ + + def update(self): + """Update packages to the latest version""" + + def find_all(self): + """Return all the installed packages""" + + def find_with_deps(self, package_names): + """Return all the installed dependencies of a list of packages. + The packages itself are also returned in the list. + + :param package_names: names of the packages to find + :returns packages with all their dependencies + """ + +class DistroInfo: + """Informations about the distribution + """ + + def __init__(self): + self.name = None + """Name""" + + self.version = None + """Version""" + + self.system_version = None + """Distro independent system version""" + + self.valid = False + """If valid we running on this distribution""" + + self.use_lib64 = False + """Install libraries in the lib64 directory""" diff --git a/devbot/plugins/ubuntu.py b/devbot/plugins/ubuntu.py index 693a227..d45aeb2 100644 --- a/devbot/plugins/ubuntu.py +++ b/devbot/plugins/ubuntu.py @@ -3,8 +3,9 @@ import subprocess from devbot import command from devbot import distro +from devbot.plugins import interfaces -class PackageManager: +class PackageManager(interfaces.PackageManager): def __init__(self, test=False, interactive=True): import apt @@ -81,7 +82,7 @@ class PackageManager: distro.register_package_manager("ubuntu", PackageManager) -class DistroInfo: +class DistroInfo(interfaces.DistroInfo): def __init__(self): self.name = None self.version = None |