]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
add flush_softspace() interface
authorGuido van Rossum <guido@python.org>
Sat, 30 Sep 1995 16:49:58 +0000 (16:49 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 30 Sep 1995 16:49:58 +0000 (16:49 +0000)
Lib/formatter.py

index 67d2b16e9a76be585cbb8e08da05ce26c531c2c6..9ff03b557b7d3a519aa5f617b869eefd8149b193 100644 (file)
@@ -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]