summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-03-28 18:56:06 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-03-28 18:56:06 +0100
commit5c9999dff1fb385b79dcb2234a9318b7d560baa5 (patch)
treebba1caaa351b2f33adb41a3b748bc82bede73520 /commands
parent721f1df01a716dcbf669ebcb0ce2875d37c2b4b3 (diff)
downloadclufter-5c9999dff1fb385b79dcb2234a9318b7d560baa5.tar.gz
clufter-5c9999dff1fb385b79dcb2234a9318b7d560baa5.tar.xz
clufter-5c9999dff1fb385b79dcb2234a9318b7d560baa5.zip
re magic @DITIT+ files: allow repeated usage
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'commands')
-rw-r--r--commands/ccs2pcs.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/commands/ccs2pcs.py b/commands/ccs2pcs.py
index 6aa5e48..ea41cf2 100644
--- a/commands/ccs2pcs.py
+++ b/commands/ccs2pcs.py
@@ -6,6 +6,7 @@
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
from ..command import Command, CommandAlias
+from ..utils import file_scan
@Command.deco(('ccs2ccsflat',
@@ -35,16 +36,17 @@ def ccs2pcs_flatiron(cmd_ctxt,
"""
#cmd_ctxt.filter()['validate'] = not nocheck
#cmd_ctxt.filter('ccs2ccsflat')['validate'] = not nocheck
- return (
- ('file', input),
- (
- ('file', ccs_pcmk),
- ('file', cib),
+ with file_scan(ccs_pcmk, cib, coro) as (ccs_pcmk, cib, coro):
+ yield (
+ ('file', input),
(
- ('file', coro),
+ ('file', ccs_pcmk),
+ ('file', cib),
+ (
+ ('file', coro),
+ )
)
)
- )
@Command.deco(('ccs2ccsflat',
@@ -70,15 +72,16 @@ def ccs2pcs_needle(cmd_ctxt,
"""
#cmd_ctxt.filter()['validate'] = not nocheck
#cmd_ctxt.filter('ccs2ccsflat')['validate'] = not nocheck
- return (
- ('file', input),
- (
- ('file', cib),
+ with file_scan(cib, coro) as (cib, coro):
+ yield (
+ ('file', input),
(
- ('file', coro),
+ ('file', cib),
+ (
+ ('file', coro),
+ )
)
)
- )
@CommandAlias.deco