Thanks Mike, it didn't occur to me that indentations are required.  :o 
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\pyrad\example\server.py", line 
259, in <module>NameError: name 'self' is not defined Now a new error.  Line 
259 refers to "fdi = select.select( self._fdmap.keys(), [], [] )[0]" > Date: 
Tue, 30 Dec 2008 08:13:38 -0600> From: m...@pythonlibrary.org> To: 
joshua__...@hotmail.com; python-win32@python.org> Subject: Re: [python-win32] 
Welcome to the "python-win32" mailing list> > Joshua Lim wrote:> > 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.py> 
> Traceback (most recent call last):> > File "server.py", line 3, in <module>> 
> from pyrad import dictionary, packet, server> > File> > "c:\python25\lib\s
 ite-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> >> > > When copying and 
pasting code from a mail reader, the indents can get> messed up. Just fix them 
yourself.> > Mike> > > > > >> > > Date: Mon, 29 Dec 2008 10:47:15 -0800> > > 
From: t...@probo.com> > > To: python-win32@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 ou t 
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, t...@probo.com> > > Providenza & Boekelheide, 
Inc.> > >> > > _______________________________________________> > > 
python-win32 mailing list> > > python-win32@python.org> > > 
http://mail.python.org/mailman/listinfo/python-win32> >> >> > 
-----------------------------------------------------
 -------------------> > Make the most of what you can do on your PC and the 
Web, just the way> > you want. Windows Live <http://www.get.live.com/wl/all>> 
_________________________________________________________________
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to