summaryrefslogtreecommitdiff
path: root/portato/backend
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/backend/catapult/system.py4
-rw-r--r--portato/backend/portage/system.py3
-rw-r--r--portato/backend/system_interface.py7
3 files changed, 14 insertions, 0 deletions
diff --git a/portato/backend/catapult/system.py b/portato/backend/catapult/system.py
index c04f997..8c84b56 100644
--- a/portato/backend/catapult/system.py
+++ b/portato/backend/catapult/system.py
@@ -32,6 +32,10 @@ class CatapultSystem (SystemInterface):
so = self.bus.get_object(catapult.get_dbus_address(catapult.DEFAULT), catapult.CATAPULT_SYSTEM_BUS, follow_name_owner_changes = True)
self.proxy = dbus.Interface(so, catapult.CATAPULT_SYSTEM_IFACE)
+ def get_version (self):
+ admint = dbus.Interface(self.bus.get_object(catapult.get_dbus_address(catapult.DEFAULT), catapult.CATAPULT_BUS), catapult.CATAPULT_ADMIN_IFACE)
+ return "Catapult: %s v. %s" % (self.proxy.bus_name.split(".")[-1], str(admint.version()))
+
def geneticize_list (self, list_of_packages, only_cpv = False):
"""Convertes a list of cpv's into L{backend.Package}s.
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index e2a00cb..5b9e6cf 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -33,6 +33,9 @@ class PortageSystem (SystemInterface):
self.settings = PortageSettings()
portage.WORLD_FILE = self.settings.settings["ROOT"]+portage.WORLD_FILE
+ def get_version (self):
+ return "Portage %s" % portage.VERSION
+
def new_package (self, cpv):
return PortagePackage(cpv)
diff --git a/portato/backend/system_interface.py b/portato/backend/system_interface.py
index fce8069..43a44ad 100644
--- a/portato/backend/system_interface.py
+++ b/portato/backend/system_interface.py
@@ -12,6 +12,13 @@
class SystemInterface (object):
+ def get_version (self):
+ """Returns the version of the used backend.
+
+ @rtype: string
+ """
+ raise NotImplementedError
+
def split_cpv (self, cpv):
"""Splits a cpv into all its parts.