event-based rfc822.py

Skip Montanaro skip at pobox.com
Fri Aug 16 06:23:43 CEST 2002


    Neale> I'd like to be able to use all of the super-keen pythonic modules
    Neale> for picking apart, say, rfc822 messages.  But those are all
    Neale> written for a Berkeley sockets model (pull), not our event model
    Neale> (push).

    Neale> Generators to the rescue!

    Neale> This modification to rfc822.py from the Python 2.2.1 distribution
    Neale> (diff below) makes a few slight changes to let it work with an
    Neale> event-based system.  But you can still use it with a traditional
    Neale> file descriptor, too.  In fact, the published API still works
    Neale> exactly as written.

While I doubt the rfc822 module is going away anytime soon, you might want
to look at Barry Warsaw's new email package.  It was new with 2.2, so you
should have access to it:

    http://www.python.org/doc/current/lib/module-email.html

-- 
Skip Montanaro
skip at pobox.com
consulting: http://manatee.mojam.com/~skip/resume.html




More information about the Python-list mailing list