summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-09-30 16:49:58 (GMT)
committerGuido van Rossum <guido@python.org>1995-09-30 16:49:58 (GMT)
commitc7ae92069d9b83b3c50ffd68b86a97a28d6f75cc (patch)
tree8c3cc1f5e0235095bce8c6950ad2ea4e254166de
parente3d9320fc570cb3a02240f41963e05a2b8d9f51a (diff)
downloadcpython-c7ae92069d9b83b3c50ffd68b86a97a28d6f75cc.zip
cpython-c7ae92069d9b83b3c50ffd68b86a97a28d6f75cc.tar.gz
cpython-c7ae92069d9b83b3c50ffd68b86a97a28d6f75cc.tar.bz2
add flush_softspace() interface
-rw-r--r--Lib/formatter.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/formatter.py b/Lib/formatter.py
index 67d2b16..9ff03b5 100644
--- a/Lib/formatter.py
+++ b/Lib/formatter.py
@@ -109,6 +109,11 @@ class AbstractFormatter:
self.nospace = self.softspace = 0
self.writer.send_literal_data(data)
+ def flush_softspace(self):
+ if self.softspace:
+ self.nospace = self.softspace = 0
+ self.writer.send_flowing_data(' ')
+
def push_font(self, (size, i, b, tt)):
if self.font_stack:
csize, ci, cb, ctt = self.font_stack[-1]