diff options
author | Martin Sivak <msivak@redhat.com> | 2008-02-11 15:42:20 +0100 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2008-02-11 15:42:20 +0100 |
commit | aad76695727f22ca6d325245ceb2ff3d1587950b (patch) | |
tree | 2cb63f47162dc68a8ecaca8ea4ca396eb69f9152 /pyfirstaidkit/interpret.py | |
parent | d4f3c35acc58dfab3c0432d936333f77c16d695a (diff) | |
download | firstaidkit-aad76695727f22ca6d325245ceb2ff3d1587950b.tar.gz firstaidkit-aad76695727f22ca6d325245ceb2ff3d1587950b.tar.xz firstaidkit-aad76695727f22ca6d325245ceb2ff3d1587950b.zip |
Add conflict flags to plugin definition
Add "activity" flags, so our "Tracker plugins logic" can work
Diffstat (limited to 'pyfirstaidkit/interpret.py')
-rw-r--r-- | pyfirstaidkit/interpret.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pyfirstaidkit/interpret.py b/pyfirstaidkit/interpret.py index ea1545e..08128ad 100644 --- a/pyfirstaidkit/interpret.py +++ b/pyfirstaidkit/interpret.py @@ -28,10 +28,23 @@ class RunDependencies(object): def __init__(self): self._provide = set() - def provide(self, id): + def provide(self, id, setactionflag = True): """Add flag""" Logger.info("Setting dependency flag %s", id) self._provide.add(id) + if setactionflag: self._provide.add(id+"?") #Action flags denote activity happening on some regular flag + + def unprovide(self, id, setactionflag = True): + """Remove flag""" + Logger.info("Resetting dependency flag %s", id) + try: + self._provide.remove(id) + except KeyError: #not there + pass + if setactionflag: self._provide.add(id+"?") + + donotprovide = unprovide #alias + failed = #alias def require(self, id): """Return True if flag is present, otherwise false""" |