from __future__ import with_statement
import contextlib as CTX
+import os as OS
from cStringIO import StringIO
import sys as SYS
def __init__(me):
"""Trivial constructor."""
- pass
+ me.warnings = []
def writeln(me, msg):
"""Write MSG, as a complete line."""
"""Write MSG to the output, with any necessary decoration."""
me._write(str(msg))
+ def warn(me, msg):
+ """Write MSG as a warning message."""
+ SYS.stderr.write('%s: %s\n' % (OS.path.basename(SYS.argv[0]), msg))
+
def close(me):
"""Wrap up when everything that needs saying has been said."""
pass
def writeln(me, msg): me._fluid.target.writeln(msg)
def close(me): me._fluid.target.close()
def header(me, **kw): me._fluid.target.header(**kw)
+ def warn(me, msg): me._fluid.target.warn(msg)
## Delegating properties.
@property
def headerp(me): return me._fluid.target.headerp
+ @property
+ def warnings(me): return me._fluid.target.warnings
## The selected output driver. Set this with `output_to'.
OUT = DelegatingOutput()