[Zope] telnetlib script help

Edward Muller edwardam at interlix.com
Sun Sep 7 13:34:25 EDT 2003


That's easy :-)

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

On Sun, 2003-09-07 at 10:33, Jack Coates wrote:
> Figured it out -- when putting it into an external method, I needed to
> return instead of just printing.
> 
> Off to the regex'ing of output now...
> 
> thanks
> Jack
> 
> On Sun, 2003-09-07 at 00:12, Edward Muller wrote:
> > Put the script in an External Method is the easiest solution most
> > likely.
> > 
> > Basically what's happening is that some python modules are considered
> > unsafe so you can't access them directly inside of zope without changing
> > zope's module permissions. 
> > 
> > The easiest work around is to put these methods into an external method.
> > 
> > Hope that helps
> > 
> > On Sat, 2003-09-06 at 18:09, Jack Coates wrote:
> > > Hi,
> > > 
> > > I'm fair-to-middlin' with Perl and have no Python knowledge. I'm trying
> > > to do a Python script which grabs some information from a telnet
> > > interface on the same machine:
> > > 
> > > import sys
> > > import telnetlib
> > > 
> > > HOST = "localhost"
> > > 
> > > tn = telnetlib.Telnet(HOST, 9090)
> > > 
> > > tn.write("title ?\n")
> > > tn.write("album ?\n")
> > > tn.write("artist ?\n")
> > > tn.write("exit\n")
> > > 
> > > print tn.read_all()
> > > 
> > > That works from the command line (well, I'll be figuring out how to
> > > regex-prettify the output later), but doesn't work from Zope: I've
> > > enabled import of sys and telnetlib, but it now pops up auth dialogs
> > > repeatedly. Hitting cancel makes it say "
> > > Error Value: You are not allowed to access write in this context".
> > > 
> > > What am I doing wrong? I'm open to making it an external method, but
> > > when I tried to do so it quit working from the command line.
> > > 
> > > thanks,
-- 
Edward Muller

Interlix (http://www.interlix.com)
Phone: 417-862-0573 - Cell: 417-844-2435 - Fax: 417-862-0572

Web Hosting - PC Service & Support - Custom Programming - Network Service & Support
Specializing in Open Source Solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.zope.org/pipermail/zope/attachments/20030907/bd79e1c8/attachment.bin


More information about the Zope mailing list