Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/plugins
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-26 11:25:03 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-26 11:25:03 (GMT)
commitd23a83060ddad0b6da5504d8cb5d524891ad9631 (patch)
treebe881c67835922bc9d1c23276047b2f0241679c1 /devbot/plugins
parentbc6035454c6138d0974173900e50e33793b2e5d0 (diff)
pep8ize
Diffstat (limited to 'devbot/plugins')
-rw-r--r--devbot/plugins/debian.py11
-rw-r--r--devbot/plugins/fedora.py4
-rw-r--r--devbot/plugins/interfaces.py4
-rw-r--r--devbot/plugins/ubuntu.py12
-rw-r--r--devbot/plugins/unknown.py4
5 files changed, 23 insertions, 12 deletions
diff --git a/devbot/plugins/debian.py b/devbot/plugins/debian.py
index 53e6bc4..26cb08c 100644
--- a/devbot/plugins/debian.py
+++ b/devbot/plugins/debian.py
@@ -5,6 +5,7 @@ from devbot import command
from devbot import distro
from devbot.plugins import interfaces
+
class PackageManager(interfaces.PackageManager):
def __init__(self, test=False, interactive=True):
import apt
@@ -70,7 +71,7 @@ class PackageManager(interfaces.PackageManager):
self._find_deps(dependency_name, result)
def find_with_deps(self, package_names):
- result = []
+ result = []
for package in package_names:
if package is not None:
@@ -83,11 +84,13 @@ class PackageManager(interfaces.PackageManager):
distro.register_package_manager("debian", PackageManager)
+
class DistroInfo(interfaces.DistroInfo):
_DEBIAN_VERSION_PATH = "/etc/debian_version"
+
def __init__(self):
- arch = self._get_architecture()
-
+ arch = self._get_architecture()
+
self.name = "debian"
self.version = "unknown"
self.gnome_version = "3.4"
@@ -116,6 +119,6 @@ class DistroInfo(interfaces.DistroInfo):
self.supported = False
def _get_architecture(self):
- return subprocess.check_output(["arch"]).strip()
+ return subprocess.check_output(["arch"]).strip()
distro.register_distro_info(DistroInfo)
diff --git a/devbot/plugins/fedora.py b/devbot/plugins/fedora.py
index df0aef7..3b6b694 100644
--- a/devbot/plugins/fedora.py
+++ b/devbot/plugins/fedora.py
@@ -5,6 +5,7 @@ from devbot import command
from devbot import distro
from devbot.plugins import interfaces
+
class PackageManager(interfaces.PackageManager):
def __init__(self, test=False, interactive=True):
self._test = test
@@ -72,7 +73,7 @@ class PackageManager(interfaces.PackageManager):
"--queryformat=[%{NAME} ]",
"--whatprovides"]
args.extend(filtered)
-
+
deps_packages = subprocess.check_output(args).strip()
for dep_package in deps_packages.split(" "):
if dep_package not in result:
@@ -81,6 +82,7 @@ class PackageManager(interfaces.PackageManager):
distro.register_package_manager("fedora", PackageManager)
+
class DistroInfo(interfaces.DistroInfo):
_FEDORA_RELEASE_PATH = "/etc/fedora-release"
diff --git a/devbot/plugins/interfaces.py b/devbot/plugins/interfaces.py
index 8c97c65..ecd2d3a 100644
--- a/devbot/plugins/interfaces.py
+++ b/devbot/plugins/interfaces.py
@@ -4,6 +4,7 @@ import subprocess
from devbot import command
from devbot import distro
+
class PackageManager:
"""Package management"""
@@ -33,6 +34,7 @@ class PackageManager:
:returns: list of packages with all the dependencies
"""
+
class DistroInfo:
"""Informations about the distribution"""
@@ -42,7 +44,7 @@ class DistroInfo:
self.version = None
"""The distribution version."""
-
+
self.gnome_version = None
"""The major version of GNOME shipped with the distribution."""
diff --git a/devbot/plugins/ubuntu.py b/devbot/plugins/ubuntu.py
index 005871c..dd0efde 100644
--- a/devbot/plugins/ubuntu.py
+++ b/devbot/plugins/ubuntu.py
@@ -6,11 +6,13 @@ from devbot.plugins import debian
distro.register_package_manager("ubuntu", debian.PackageManager)
+
class DistroInfo(interfaces.DistroInfo):
- _OS_RELEASE_PATH="/etc/os-release"
+ _OS_RELEASE_PATH = "/etc/os-release"
+
def __init__(self):
arch = self._get_architecture()
-
+
self.name = "ubuntu"
self.version = "unknown"
self.gnome_version = "3.4"
@@ -33,10 +35,10 @@ class DistroInfo(interfaces.DistroInfo):
except IOError:
release = None
self.valid = False
-
+
if os_info["ID"] != "ubuntu":
self.valid = False
-
+
self.version = os_info.get("VERSION_ID", None)
if self.version != "12.10":
@@ -46,6 +48,6 @@ class DistroInfo(interfaces.DistroInfo):
self.gnome_version = "3.6"
def _get_architecture(self):
- return subprocess.check_output(["uname", "-i"]).strip()
+ return subprocess.check_output(["uname", "-i"]).strip()
distro.register_distro_info(DistroInfo)
diff --git a/devbot/plugins/unknown.py b/devbot/plugins/unknown.py
index 576edef..5e3f530 100644
--- a/devbot/plugins/unknown.py
+++ b/devbot/plugins/unknown.py
@@ -5,6 +5,7 @@ from devbot import command
from devbot import distro
from devbot.plugins import interfaces
+
class PackageManager(interfaces.PackageManager):
def __init__(self, test=False, interactive=True):
pass
@@ -26,6 +27,7 @@ class PackageManager(interfaces.PackageManager):
distro.register_package_manager("unknown", PackageManager)
+
class DistroInfo(interfaces.DistroInfo):
def __init__(self):
self.lib_dir = None
@@ -35,5 +37,5 @@ class DistroInfo(interfaces.DistroInfo):
self.gstreamer_version = "0.10"
self.valid = True
self.supported = False
-
+
distro.register_distro_info(DistroInfo)