I've already done this. I did this a couple months ago and posted the
diff to the list.
def read(name):
if posixpath.isfile(name):
f = open(name,'r')
db = marshal.load(f)
f.close()
return db
# END
else:
return {}
# END
# END
def write(db,name):
f = open(name,'w')
marshal.dump(db, f)
f.close()
# END
Yes, the word 'END' lines up with the block body instead... py-mode
groks the '# END' tokens properly to allow indent-region & the like to
work.
And it requires no changes to python. I dont see a reason to add this
to python at this late date. Either use emacs, or write a 'indent' for
python code that also groks these.
If people want this, then pester Tim to add it to py-mode. (Tim, I
assume you still have the diff I posted. I havent mangled the new
py-mode yet.)
-- John Redford (AKA GArrow) | 3,600 hours of tape. jredford@lehman.com | 5 cans of Scotchguard.