##// END OF EJS Templates
Merge pull request #1369 from minrk/EngineError...
Merge pull request #1369 from minrk/EngineError load header with engine id when engine dies in TaskScheduler This ensures that the metadata dict on the Client has the engine_uuid of the engine on which the task failed. Previously, this entry would remain empty. It is identical to code elsewhere (Hub, Client) for constructing the dummy reply when engines die.

File last commit:

r4872:34c10438
r6098:0291d619 merge
Show More
ipy_server.py
37 lines | 1023 B | text/x-python | PythonLexer
vivainio
integrate recent changes from ipy_unicode_cleanup branch
r910 """ Simple TCP socket server that executes statements in IPython instance.
Usage:
import ipy_server
ipy_server.serve_thread(16455)
Now, to execute the statements in this ipython instance, open a TCP socket
Bernardo B. Marques
remove all trailling spaces
r4872 (port 16455), write out the statements, and close the socket.
vivainio
integrate recent changes from ipy_unicode_cleanup branch
r910 You can use e.g. "telnet localhost 16455" or a script to do this.
This is a bit like 'M-x server-start" or gnuserv in the emacs world.
"""
Brian Granger
ipapi.py => core/ipapi.py and imports updated.
r2027 from IPython.core import ipapi
ip = ipapi.get()
vivainio
integrate recent changes from ipy_unicode_cleanup branch
r910
import SocketServer
# user-accessible port
PORT = 8099
class IPythonRequestHandler(SocketServer.StreamRequestHandler):
def handle(self):
#print "connection from", self.client_address
inp = self.rfile.read().replace('\r\n','\n')
#print "Execute",inp
ip.runlines(inp)
def serve(port = PORT):
server = SocketServer.TCPServer(("", port), IPythonRequestHandler)
print "ipy_server on TCP port", port
server.serve_forever()
def serve_thread(port = PORT):
import thread
thread.start_new_thread(serve, (port,))