from __future__ import * 8.11.2003


Yet Another Line Ending Conversion Program

This is what I've been using.. it's really simple, and should convert Win32, Mac, or Unix line endings to whatever your native line ending is. A possible future optimization would be to use temp files instead, but they're annoying.

#!/usr/bin/env python
import sys, os, shutil
from cStringIO import StringIO

def tonative(fname):
    buff = StringIO()
    infile = file(fname, 'rU')
    if infile.newlines == os.linesep:
    for line in infile:
        buff.write(line.strip() + os.linesep)
    outfile = file(fname, 'wb')
    shutil.copyfileobj(buff, outfile)

if __name__ == '__main__':
    for fname in sys.argv[1:]:

Is there any way to syntax highlight Python code in PyDS structured text?

Update: There is now, but I had to write it :) Details coming shortly.

posted at 15:52:16    #    comment []    trackback []

First thoughts about PyDS

  • It's not always responsive. Needs to be refactored to be more async.

  • There should be a button that rewrites your preview. I can't get it to refresh after editing a blog entry?

  • What the heck are those timers? Why are there 4 "backup databases" in the list? Can I edit them? Is that what add means?

  • What's an enclosure?

  • (Maybe a PyCS question) how do I get notified when someone comments?

  • How do I put syntax highlighted Python code in a structured text entry? Do I have to hack the code, or just do it as HTML and use another tool?

posted at 01:20:48    #    comment []    trackback []
      1 2
3 4 5 6 7 8 9
Oct Dec

Bob's Rants

XML-Image Letterimage

© 2003-2004, Bob Ippolito