From 102c54705debb1dc880b066c9d92261ee4ef6088 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Mon, 26 Nov 2012 12:25:50 +0000 Subject: Add documentation for the distro specific classes --- (limited to 'devbot') 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 -- cgit v0.9.1