Using nntplib

Peter Hansen peter at engcorp.com
Thu May 30 19:54:30 EDT 2002


jb wrote:
> 
> Steve Holden wrote:
> >     http://pydish.holdenweb.com/pwp/chp5notes.htm
> >
> > As far as informing the GUI thread about what's been received so far,
> > whether you use LIST or XOVER perhaps you could just put the headers onto
> > a Queue (see that Queue module) and letting the GUI thread take them off.
> > That should ease up any critical-section issues.
> 
> Thx, this sounds intresting. But I should have to change nntplib, should I
> not? That I should use queues, is obvious. Should I insert enqueueing (?)
> at the position I marked in my first posting?
> 
> Maybe the best solution would be to use QSockets (as I work with PyQt). Then
> I can use Qt signaling in a very natural way. I could create a new,
> asynchronous version of nntplib, that works with Qt signals (and this seems
> easy as nntplib is nicely documented and clear). What do you think of this?

You might want to keep your NNTP stuff decoupled from Qt, which is 
(a) not standard, and (b) more intended for graphical user interfaces,
as I understand it.  It's a good design principle to keep separate
the various portions of your system like this.  Using something like
Queue makes the code more modular, and more maintainable as a result.

-Peter



More information about the Python-list mailing list