summaryrefslogtreecommitdiffstats
path: root/command.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-04-01 17:33:30 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-04-01 17:39:16 +0200
commit32408f6fbab818a892ef81189034eb8bcdf636d7 (patch)
tree3f18169b61aada6911006d618003a67738d2ebfe /command.py
parente9badd8f50176a42f9a73cdf94d08fb531f94d3d (diff)
downloadclufter-32408f6fbab818a892ef81189034eb8bcdf636d7.tar.gz
clufter-32408f6fbab818a892ef81189034eb8bcdf636d7.tar.xz
clufter-32408f6fbab818a892ef81189034eb8bcdf636d7.zip
command: postpone "magic @DITIT+ files: allow repeated usage"
Fix of fd5d965c6cd1e406764819bc29c2508d39d462b3. ... because in case of backtrack, io_decl would be already converted once and then, a new attempt to convert would be initiated, leading to failure (alternatively, a routine should be expected for that). Also remove unnecessary debug-only logging. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'command.py')
-rw-r--r--command.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/command.py b/command.py
index ab02a3f..a3fca1f 100644
--- a/command.py
+++ b/command.py
@@ -311,18 +311,6 @@ class Command(object):
# not INFILTER in either mode (nor output already precomputed?)
log.debug("Run `{0}' filter with `{1}' io decl. as DOWNFILTER"
.format(flt.__class__.__name__, io_decl))
- # turning @DIGIT+ magic files into fileobjs (needs global view)
- fd = SimpleFormat.io_decl_fd(io_decl)
- if fd is not None:
- if fd not in magic_fds:
- try:
- magic_fds[fd] = fdopen(fd, 'ab')
- except (OSError, IOError):
- # keep untouched
- pass
- log.debug("before: {0}".format(io_decl))
- io_decl = args2sgpl(io_decl[0], magic_fds[fd], *io_decl[2:])
- log.debug("after: {0}".format(io_decl))
inputs = map(lambda x: cmd_ctxt.filter(x.__class__.__name__)['out'],
filter_backtrack[flt])
notyet, ok = bifilter(lambda x:
@@ -338,6 +326,18 @@ class Command(object):
worklist.extend(reversed(tuple((ny, None)
for ny in notyet)))
continue
+
+ # turning @DIGIT+ magic files into fileobjs (needs global view)
+ fd = SimpleFormat.io_decl_fd(io_decl)
+ if fd is not None:
+ if fd not in magic_fds:
+ try:
+ magic_fds[fd] = fdopen(fd, 'ab')
+ except (OSError, IOError):
+ # keep untouched
+ pass
+ io_decl = args2sgpl(io_decl[0], magic_fds[fd], *io_decl[2:])
+
assert all(inputs)
in_obj = flt.in_format.as_instance(*inputs)
if not flt_ctxt['out'] or flt not in terminals: