mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
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.
This commit is contained in:
parent
36fc11e894
commit
ccd8b19c99
1 changed files with 4 additions and 1 deletions
|
@ -10,7 +10,10 @@ AS_IS = None
|
||||||
|
|
||||||
class NullFormatter:
|
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 end_paragraph(self, blankline): pass
|
||||||
def add_line_break(self): pass
|
def add_line_break(self): pass
|
||||||
def add_hor_rule(self, abswidth=None, percentwidth=1.0,
|
def add_hor_rule(self, abswidth=None, percentwidth=1.0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue