| Joel Uckelman on Mon, 6 Dec 2004 13:03:53 -0600 (CST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: [nimh-dev] inc |
Thus spake "Jon Stewart": > > # NB: we can make this return whatever we want; > > # maybe files would be better than email.Messages (or our subclass)? > > > Yes. Files would be better. Once they're copied, then we can treat them as > messages. The reason I was thinking of them as messages is that inc needs to be able to print scan lines. That also seems to argue for scan being a function in an nimh library, which scan.py just calls. > > while 1: # it irriates me that you can't do assignment > > # in a while loop condition > > > I think you can rewrite this as: > > for m in box: > # all the stuff > > If something has a next(), it's usually iterable. I'm not so sure about that in this case. It's worth a shot. > > # TODO: do something to truncate the spool if we're reading from it > > > Looks good. Does the mailbox module support locking? That would be nifty. Not that I see. There's no need to worry about locking for Maildirs, becuase each file is exactly one message and has a unique name. fcntl might be the module we need for locking, maybe using fnctl.flock(). The fnctl module is Unix-only. There's a note to see also: os.open(), but I don't find a discussion of file locking there. _______________________________________________ nimh-dev mailing list nimh-dev@xxxxxxxxxxx http://lists.ellipsis.cx/mailman/listinfo/nimh-dev