[Zope] How to change view of all *.txt?

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Tue, 15 Feb 2000 17:47:08 +1100 (EST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-641490624-950597228=:15941
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Tue, 15 Feb 2000, Robb Shecter wrote:

> * An external Python method that will reformat a text file to a
> particular line length

This one - its what I do. Useful for displaying text input in a
textarea as preformatted amongst other things.

I've attached one I use for posterity.

-- 
 ___
   //     Zen (alias Stuart Bishop)     Work: zen@cs.rmit.edu.au
  // E N  Senior Systems Alchemist      Play: zen@shangri-la.dropbear.id.au
 //__     Computer Science, RMIT 	 WWW: http://www.cs.rmit.edu.au/~zen

---559023410-641490624-950597228=:15941
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="wrap.py"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.4.10.10002151747080.15941@goanna.cs.rmit.edu.au>
Content-Description: 
Content-Disposition: attachment; filename="wrap.py"

aW1wb3J0IHJlDQppbXBvcnQgc3RyaW5nDQoNCl9zdHJpcHN0YXJ0ID0gcmUu
Y29tcGlsZSgnXihccypbXG5ccl0pKycpDQoNCmRlZiB3cmFwKHRleHQsd2lk
dGg9NzApOg0KDQogICAgIyBTdHJpcCB0cmFpbGluZyB3aGl0ZXNwYWNlIGFu
ZCBleHBhbmQgdGFicyBmb3IgcHJvcGVyIGNvdW50aW5nLg0KICAgIHRleHQg
PSBzdHJpbmcuZXhwYW5kdGFicyhzdHJpbmcucnN0cmlwKHRleHQpKQ0KDQog
ICAgIyBTdHJpcCBhbGwgbGVhZGluZyBibGFuayBsaW5lcw0KICAgIHRleHQg
PSBfc3RyaXBzdGFydC5zdWIoJycsdGV4dCwxKQ0KDQogICAgIyBPdXIgb3V0
cHV0DQogICAgb3V0ID0gJycNCg0KICAgICMgV2hlbiBJIGdyb3cgdXAsIEkg
d2F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