]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Word-wrap the list of cross-references.
authorKa-Ping Yee <ping@zesty.ca>
Fri, 13 Apr 2001 11:02:51 +0000 (11:02 +0000)
committerKa-Ping Yee <ping@zesty.ca>
Fri, 13 Apr 2001 11:02:51 +0000 (11:02 +0000)
Lib/pydoc.py

index 7e770388495e0c56fa8ebf75e94f8a2ed2ef7d1e..1bce955ffa9f426fc0133555326220a5a13ad95a 100755 (executable)
@@ -1398,7 +1398,11 @@ please set the environment variable PYTHONDOCS to indicate their location.
         parser.feed(document)
         buffer = replace(buffer.getvalue(), '\xa0', ' ', '\n', '\n  ')
         pager('  ' + strip(buffer) + '\n')
-        if xrefs: self.output.write('\nRelated help topics: %s\n' % xrefs)
+        if xrefs:
+            buffer = StringIO.StringIO()
+            formatter.DumbWriter(buffer).send_flowing_data(
+                'Related help topics: ' + join(split(xrefs), ', ') + '\n')
+            self.output.write('\n%s\n' % buffer.getvalue())
 
     def listmodules(self, key=''):
         if key: