Movatterモバイル変換


[0]ホーム

URL:


Up one LevelPython Library ReferenceContentsModule IndexIndex


16.11.1 Template Objects

Template objects following methods:

reset()
Restore a pipeline template to its initial state.

clone()
Return a new, equivalent, pipeline template.

debug(flag)
Ifflag is true, turn debugging on. Otherwise, turn debuggingoff. When debugging is on, commands to be executed are printed, andthe shell is givenset -x command to be more verbose.

append(cmd, kind)
Append a new action at the end. Thecmd variable must be a validbourne shell command. Thekind variable consists of two letters.

The first letter can be either of'-' (which means the commandreads its standard input),'f' (which means the commands readsa given file on the command line) or'.' (which means the commandsreads no input, and hence must be first.)

Similarly, the second letter can be either of'-' (which means the command writes to standard output),'f' (which means the command writes a file on the command line) or'.' (which meansthe command does not write anything, and hence must be last.)

prepend(cmd, kind)
Add a new action at the beginning. Seeappend() for explanationsof the arguments.

open(file, mode)
Return a file-like object, open tofile, but read from orwritten to by the pipeline. Note that only one of'r','w' may be given.

copy(infile, outfile)
Copyinfile tooutfile through the pipe.


Up one LevelPython Library ReferenceContentsModule IndexIndex

Release 2.5.2, documentation updated on 21st February, 2008.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2025 Movatter.jp