Add support for dumping XMLs to the standard output.

This commit is contained in:
Roozbeh Pournader 2014-06-27 11:20:59 -07:00 committed by Behdad Esfahbod
parent 83a89c123f
commit 365b0bfce1
2 changed files with 4 additions and 1 deletions

View File

@ -11,6 +11,8 @@ INDENT = " "
class XMLWriter(object):
def __init__(self, fileOrPath, indentwhite=INDENT, idlefunc=None):
if fileOrPath == '-':
fileOrPath = sys.stdout
if not hasattr(fileOrPath, "write"):
try:
# Python3 has encoding support.

View File

@ -15,7 +15,8 @@ usage: ttx [options] inputfile1 [... inputfileN]
-h Help: print this message
-d <outputfolder> Specify a directory where the output files are
to be created.
-o <outputfile> Specify a file to write the output to.
-o <outputfile> Specify a file to write the output to. A special
value of of - would use the standard output.
-v Verbose: more messages will be written to stdout about what
is being done.
-q Quiet: No messages will be written to stdout about what