summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-05-30 16:12:38 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-05-30 16:14:33 +0200
commit64dccfab85f9d583cbd32a0120f8e750b23c5290 (patch)
treeddb40d37bb617074399aad6a156a98a8e692777a /utils.py
parent6ffbfd7521b6796488b27aa7d82765b8a7346692 (diff)
downloadclufter-64dccfab85f9d583cbd32a0120f8e750b23c5290.tar.gz
clufter-64dccfab85f9d583cbd32a0120f8e750b23c5290.tar.xz
clufter-64dccfab85f9d583cbd32a0120f8e750b23c5290.zip
format: refactor out some tuplist-realated normalizations
...to utils.py Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 1b6dacd..2ae2c6d 100644
--- a/utils.py
+++ b/utils.py
@@ -13,6 +13,10 @@ tuplist = lambda x: isinstance(x, (tuple, list))
# turn args into tuple unless single tuplist arg
args2sgpl = \
lambda x=(), *y: x if not y and tuplist(x) else (x, ) + y
+args2combsgpl = arg2wrapped = \
+ lambda x=(), *y: x if not y and tuplist(x) and len(x) > 1 else (x, ) + y
+args2unwrapped = \
+ lambda x=None, *y: x if not y else (x, ) + y
# turn args into tuple unconditionally
args2tuple = lambda *args: tuple(args)
any2iter = \