[python-win32] Welcome to the "python-win32" mailing list

Joshua Lim joshua__lim at hotmail.com
Mon Dec 29 20:00:32 CET 2008


Hi Tim, 
 
Thanks for helping.
 
I replaced your code from def Run( self ): onwards, but got an error:
 
C:\Python25\pyrad\example>c:\python25\python server.pyTraceback (most recent call last):  File "server.py", line 3, in <module>    from pyrad import dictionary, packet, server  File "c:\python25\lib\site-packages\pyrad-1.1-py2.5.egg\pyrad\server.py", line 259    fdi = select.select( self._fdmap.keys(), [], [] )[0]      ^IndentationError: expected an indented block
Rgds,
Joshua
> Date: Mon, 29 Dec 2008 10:47:15 -0800> From: timr at probo.com> To: python-win32 at python.org> Subject: Re: [python-win32] Welcome to the "python-win32" mailing list> > Tim Roberts wrote:> > Well, "select" is not just a drop-in replacement for "poll", although it> > can serve the same function. Without looking at the rest of the source,> > you probably want something like this:> >> > def Run( self ):> > self._fdmap = {}> > self._PrepareSockets()> > while 1:> > fdi = select.select( self._fdmap, [], [] )[0]> > > > I just realized this is not correct. _fdmap is a dictionary, and it> needs to be a list of FDs. _fdmap probably contains the list of read> FDs, write FDs, and other FDs -- exactly the way select.select wants> them -- but you'll have to look inside _PrepareSockets to know how to> pull out the three individual lists.> > OK, after looking at the source, I think the list of fds is actually the> keys of the dictionary, so we need two small changes:> > def Run( self ):> self._fdmap = {}> self._PrepareSockets()> while 1:> fdi = select.select( self._fdmap.keys(), [], [] )[0]> if fdi:> self._ProcessInput( self._fdmap[fdi[0]] )> else:> logger.error( "select returned empty." )> > -- > Tim Roberts, timr at probo.com> Providenza & Boekelheide, Inc.> > _______________________________________________> python-win32 mailing list> python-win32 at python.org> http://mail.python.org/mailman/listinfo/python-win32
_________________________________________________________________
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20081229/2c8cc457/attachment.htm>


More information about the python-win32 mailing list