[Zope] telnetlib script help
Edward Muller
edwardam at interlix.com
Sun Sep 7 03:12:22 EDT 2003
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/ac45fc79/attachment.bin
More information about the Zope
mailing list