summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-06-17 18:14:10 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-06-17 18:32:06 +0200
commitd94d3888ae66386ae62b7df2f0eeb372fdf41c8a (patch)
tree193fc6ae151aaa24c5f78d1933edcee01ce6b7e1 /utils.py
parent7bd7501d6b948ac43588d22766dddf16e29ef69d (diff)
downloadclufter-d94d3888ae66386ae62b7df2f0eeb372fdf41c8a.tar.gz
clufter-d94d3888ae66386ae62b7df2f0eeb372fdf41c8a.tar.xz
clufter-d94d3888ae66386ae62b7df2f0eeb372fdf41c8a.zip
utils: reconcile forgotten "filter" funcs renaming
This parallel refactoring tainted/affected several commits back, starting with f1a9f5e. This should be fine now. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/utils.py b/utils.py
index 2253b2f..00cf5cc 100644
--- a/utils.py
+++ b/utils.py
@@ -29,12 +29,20 @@ head_tail = \
(x, args2sgpl(*y)) if not tuplist(x) or kwargs.get('stop', 0) \
else (head_tail(stop=1, *tuple(x) + y))
-filtervars = \
- lambda src, which: dict((x, src[x]) for x in which if x in src)
-filtervarsdef = \
- lambda src, which: dict((x, src[x]) for x in which if src.get(x, None))
-filtervarspop = \
- lambda src, which: dict((x, src.pop(x)) for x in which if x in src)
+nonetype = type(None)
+
+filterdict_keep = \
+ lambda src, *which, **kw: \
+ dict((x, src[x]) for x in which if x in src, **kw)
+filterdict_invkeep = \
+ lambda src, *which, **kw: \
+ dict((x, src[x]) for x in src.iterkeys() if x not in which, **kw)
+filterdict_pop = \
+ lambda src, *which, **kw: \
+ dict((x, src.pop(x)) for x in which if x in src, **kw)
+filterdict_invpop = \
+ lambda src, *which, **kw: \
+ dict((x, src.pop(x)) for x in src if x in which, **kw)
#