diff options
author | Guido van Rossum <guido@python.org> | 1996-10-07 21:29:49 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-10-07 21:29:49 (GMT) |
commit | ccd8b19c99c353950c54d9818bb57c408df09a53 (patch) | |
tree | 70b95d07623f64ee5f81b9d3734cb09fbcddaa29 /Lib | |
parent | 36fc11e894510d1521a934f3e77d596e94431c2f (diff) | |
download | cpython-ccd8b19c99c353950c54d9818bb57c408df09a53.zip cpython-ccd8b19c99c353950c54d9818bb57c408df09a53.tar.gz cpython-ccd8b19c99c353950c54d9818bb57c408df09a53.tar.bz2 |
Add provisions to set the (to be documented!) instance variable
'writer' of the NullFormatter to the writter passed in, or to a
NullWriter if none (or None) is passed in.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/formatter.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/formatter.py b/Lib/formatter.py index c192e20..79be0f6 100644 --- a/Lib/formatter.py +++ b/Lib/formatter.py @@ -10,7 +10,10 @@ AS_IS = None class NullFormatter: - def __init__(self, writer): pass + def __init__(self, writer=None): + if not writer: + writer = NullWriter() + self.writer = writer def end_paragraph(self, blankline): pass def add_line_break(self): pass def add_hor_rule(self, abswidth=None, percentwidth=1.0, |