[Twisted-Python] twisted.news cleanups and tests

Bob Ippolito bob at redivi.com
Sun Apr 13 13:37:42 EDT 2003

On Sunday, Apr 13, 2003, at 03:53 America/New_York, Tim Allen wrote:

> On Sunday, Apr 13, 2003, at 16:16 Australia/Sydney, Glyph Lefkowitz 
> wrote:
> <snip>
>> twisted.im also needs to be refactored, in order to make its API more 
>> coherent and easier to register observers of.  However, it remains 
>> unclear whether this kind of functionality actually deserves a 
>> separate package (that .words will use) or whether it will go into 
>> .words directly.  Moshe has me mostly convinced that it should remain 
>> an independant package, since real-time-client code is going to look 
>> significantly different to abstract-message-processing-and-forwarding 
>> code.
>> Thoughts?
> I'll be watching this with interest. I'm not going to say it's 
> impossible or crazy, but I'd like to see how all the inherent 
> difficulties in making a "generic messagey thing" are overcome.
> From the top of my head:
>  - IMAP and NNTP have a bunch of folders, POP3 has just one.

But from a client perspective, everything but the inbox ends up 
locally.. so you could have the UI be just like IMAP or NNTP, you would 
just augment the POP3 account(s) with a local datastore.

>  - IMAP lets you create folders and move messages about, NNTP doesn't.

So perhaps you just raise exceptions if you try and move messages on a 
NNTP server?

>  - Instant messaging apps have no folders, but you could no doubt 
> synthesise an 'inbox'. Some IM systems let you have 'categories' of 
> buddies, which you might present as message folders. However, then IM 
> has the restriction that a given folder can only contain messages from 
> one recipient, which is not the case with IMAP or NNTP.

AIM has a "chat room" feature which would allow multiple participant 

>  - POP3 and NNTP need to be polled for new messages, IM protocols 
> alert you when a new message comes in. I'm not sure which way IMAP 
> goes.

So you have a unified "notification center" type API.  Whether it gets 
notified async or needs to poll to generate notifications is just an 
implementation detail for each protocol.

>  - Email and usenet messages generally have a variety of interesting 
> and useful headers that end-user applications are going to want to 
> look at, IM messages do not.

IM messages have sender/recipient addresses and timestamps.. A chat 
room could have a bunch of "CC's".  What headers other than 
from/date/to/subject/etc are ever really that useful?

>  - IMAP and IM are stateful protocols, POP3 is not. I'm not sure about 

That's a protocol implementation detail.  Twisted is very good at 
stateful protocols.. just because POP3 isn't completely stateful 
(although it does keep state as to whether or not you're authenticated) 
doesn't really change anything.

>  - Email and usenet messages have message-threading, IM does not.

IM is sort of threaded.. each conversation with each person could be 
considered a thread.. It's certainly not like a conversation with a 
particular person is a set of completely unrelated messages (although 
it can be :).


More information about the Twisted-Python mailing list