Message195020
What about a multiline summarize? The textwrap module is designed to work with multiline text.
Let we want wrap 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' in 40 column and shorten it to three lines:
Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore (...)
For this we need to add two arguments for TextWrapper: max_lines and placeholder. Then shorten() will be just fill() with max_lines=1. |
|
Date |
User |
Action |
Args |
2013-08-12 21:22:11 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, barry, georg.brandl, pitrou, ezio.melotti, steven.daprano, r.david.murray, python-dev, vajrasky |
2013-08-12 21:22:11 | serhiy.storchaka | set | messageid: <1376342531.01.0.377875701825.issue18585@psf.upfronthosting.co.za> |
2013-08-12 21:22:10 | serhiy.storchaka | link | issue18585 messages |
2013-08-12 21:22:10 | serhiy.storchaka | create | |
|