diff options
author | Martin Sivak <msivak@redhat.com> | 2008-04-18 15:58:46 +0200 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2008-04-18 15:58:46 +0200 |
commit | e8a8395ccc7f48f170bef7f348096f2a91f8d10d (patch) | |
tree | 29659d8b31d2faffb3c1bcd88c68459e0b827c13 /pyfirstaidkit/interpret.py | |
parent | 3c7dbfa8e712ea250f3da0aee2bc6d9eab5b265c (diff) | |
download | firstaidkit-e8a8395ccc7f48f170bef7f348096f2a91f8d10d.tar.gz firstaidkit-e8a8395ccc7f48f170bef7f348096f2a91f8d10d.tar.xz firstaidkit-e8a8395ccc7f48f170bef7f348096f2a91f8d10d.zip |
Flag system is able to list all known flags
Diffstat (limited to 'pyfirstaidkit/interpret.py')
-rw-r--r-- | pyfirstaidkit/interpret.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pyfirstaidkit/interpret.py b/pyfirstaidkit/interpret.py index ace5cea..5217939 100644 --- a/pyfirstaidkit/interpret.py +++ b/pyfirstaidkit/interpret.py @@ -29,6 +29,7 @@ class RunDependencies(object): """Encapsulate flags used to control the dependencies between plugins""" def __init__(self): self._provide = set() + self._known = set() def provide(self, id, setactionflag = True): """Add flag""" @@ -52,6 +53,18 @@ class RunDependencies(object): """Return True if flag is present, otherwise false""" return id in self._provide + def introduce(self, s): + """Notifies the system about dependency names used in the plugins, so we can list them in help""" + self._known = self._known.union(s) + + def known(self): + """Returns list of known flags""" + return list(self._known) + + def valid(self): + """Returns list of valid/provided flags""" + return list(self._provide) + class Tasker: """The main interpret of tasks described in Config object""" |