Author steven.daprano
Recipients barry, ezio.melotti, georg.brandl, pitrou, steven.daprano, vajrasky
Date 2013-08-02.17:12:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375463524.89.0.156546355607.issue18585@psf.upfronthosting.co.za>
In-reply-to
Content
A function like this often gets called to truncate lots of lines. Unfortunately for many use-cases, the part truncated is the most significant part of the line. E.g.:

Scanning file:
/home/fred/documents/datafil...
/home/fred/documents/datafil...
/home/fred/documents/datafil...
/home/fred/documents/datafil...


It's often better in cases like this to truncate in the middle:

Scanning file:
/home/fred/doc...datafile01.txt
/home/fred/doc...datafile02.txt
/home/fred/doc...datafile03.txt
/home/fred/doc...datafile04.txt

(I believe Mac OS-X routinely truncates long lines in the middle in this way.)

Perhaps there could be an argument controlling where to truncate (left, right or centre). A good use-case for the new Enums, perhaps? :-)
History
Date User Action Args
2013-08-02 17:12:04steven.dapranosetrecipients: + steven.daprano, barry, georg.brandl, pitrou, ezio.melotti, vajrasky
2013-08-02 17:12:04steven.dapranosetmessageid: <1375463524.89.0.156546355607.issue18585@psf.upfronthosting.co.za>
2013-08-02 17:12:04steven.dapranolinkissue18585 messages
2013-08-02 17:12:04steven.dapranocreate