API Reference for Enthought Tool Suite 3.2.0

Powerful utility for running a TCP/UDP server that is used to script Mayavi2 from the network. This uses Twisted. This particular version has been written for the wxPython, adding support for a Qt4 version should be trivial.

The key functions exposed are:

serve_tcp(...)
serve_udp(...)

See the function documentation for more information. Here is sample usage:

from enthought.mayavi import mlab
from enthought.mayavi.tools import server
mlab.test_plot3d()
server.serve_tcp()

The TCP server will listen on port 8007 by default in the above. Any data sent to the server is simply exec'd, meaning you can do pretty much anything you want. The engine, scene, camera and mlab are all available and can be used. For example after running the above you can do this:

$ telnet localhost 8007
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
scene.camera.azimuth(45)
mlab.clf()
mlab.test_contour3d()
scene.camera.zoom(1.5)

The nice thing about this is that you do not loose any interactivity of your app and can continue to use its UI as before, any network commands will be simply run on top of this.

Warning while this is very powerful it is also a huge security hole since the remote user can do pretty much anything they want.

Classes

Function summary

Functions

Imported Names

Local nameRefers to
DatagramProtocoltwisted.internet.protocol.DatagramProtocol
Factorytwisted.internet.protocol.Factory
logtwisted.python.log
Protocoltwisted.internet.protocol.Protocol
reactortwisted.internet.reactor
syssys
wxwx
wxreactortwisted.internet.wxreactor

© Copyright 2002-2009 Enthought, Inc.