summaryrefslogtreecommitdiff
path: root/portato/backend/system_interface.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/backend/system_interface.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/portato/backend/system_interface.py b/portato/backend/system_interface.py
index 4b0f8df..1cb0ed1 100644
--- a/portato/backend/system_interface.py
+++ b/portato/backend/system_interface.py
@@ -11,6 +11,26 @@
# Written by René 'Necoro' Neumann <necoro@necoro.net>
class SystemInterface (object):
+
+ SET_ALL = "__portato_all__"
+ SET_TREE = "__portato_tree__"
+ SET_INSTALLED = "__portato_installed__"
+ SET_UNINSTALLED = "__portato_uninstalled__"
+
+ def has_set_support (self):
+ """Signals, whether this backend supports sets.
+
+ @rtype: boolean
+ """
+ raise NotImplementedError
+
+ def get_sets (self):
+ """Returns all supported sets in tuples consisting of name and description.
+ If sets aren't supported, at least "world" and "system" have to be returned.
+
+ @rtype: iter(string, string)
+ """
+ raise NotImplementedError
def get_version (self):
"""Returns the version of the used backend.
@@ -75,7 +95,7 @@ class SystemInterface (object):
raise NotImplementedError
- def find_packages (self, key, pkgSet = "all", masked = False, with_version = True, only_cpv = False):
+ def find_packages (self, key, pkgSet = SET_ALL, masked = False, with_version = True, only_cpv = False):
"""This returns a list of packages matching the key.
As key, it is allowed to use basic regexps (".*") and the normal package specs. But not a combination
of them.