##// END OF EJS Templates
A better or standar formatting of the code block
muzgash -
Show More
@@ -22,46 +22,24 b' This GUI will allow for the easy editing of multi-line input and the convenient '
22 ++++++++++++++++++++++++++
22 ++++++++++++++++++++++++++
23 Since the necessity of a user to keep his data safe, the design is based in a 2-process model that will be achieved with a simple client/server system with `pyzmq <http://www.zeromq.org/bindings:python>`_, so the GUI session do not crash if the the kernel process does. This will be achieved using this test `code <http://github.com/fperez/pyzmq/blob/completer/examples/kernel/kernel.py>`_ and customizing it to the necessities of the GUI such as queue management with discrimination for different frontends connected to the same kernel and tab completion. A piece of drafted code for the kernel (server) should look like this:
23 Since the necessity of a user to keep his data safe, the design is based in a 2-process model that will be achieved with a simple client/server system with `pyzmq <http://www.zeromq.org/bindings:python>`_, so the GUI session do not crash if the the kernel process does. This will be achieved using this test `code <http://github.com/fperez/pyzmq/blob/completer/examples/kernel/kernel.py>`_ and customizing it to the necessities of the GUI such as queue management with discrimination for different frontends connected to the same kernel and tab completion. A piece of drafted code for the kernel (server) should look like this:
24
24
25
25 def main():
26
26 c = zmq.Context(1, 1)
27 *def main():*
27 rep_conn = connection % port_base
28
28 pub_conn = connection % (port_base+1)
29 *c = zmq.Context(1, 1)*
29 print >>sys.__stdout__, "Starting the kernel..."
30
30 print >>sys.__stdout__, "On:",rep_conn, pub_conn
31 *rep_conn = connection % port_base*
31 session = Session(username=u'kernel')
32
32 reply_socket = c.socket(zmq.XREP)
33 *pub_conn = connection % (port_base+1)*
33 reply_socket.bind(rep_conn)
34
34 pub_socket = c.socket(zmq.PUB)
35 *print >>sys.__stdout__, "Starting the kernel..."*
35 pub_socket.bind(pub_conn)
36
36 stdout = OutStream(session, pub_socket, u'stdout')
37 *print >>sys.__stdout__, "On:",rep_conn, pub_conn*
37 stderr = OutStream(session, pub_socket, u'stderr')
38
38 sys.stdout = stdout
39 *session = Session(username=u'kernel')*
39 sys.stderr = stderr
40
40 display_hook = DisplayHook(session, pub_socket)
41 *reply_socket = c.socket(zmq.XREP)*
41 sys.displayhook = display_hook
42
42 kernel = Kernel(session, reply_socket, pub_socket)
43 *reply_socket.bind(rep_conn)*
44
45 *pub_socket = c.socket(zmq.PUB)*
46
47 *pub_socket.bind(pub_conn)*
48
49 *stdout = OutStream(session, pub_socket, u'stdout')*
50
51 *stderr = OutStream(session, pub_socket, u'stderr')*
52
53 *sys.stdout = stdout*
54
55 *sys.stderr = stderr*
56
57 *display_hook = DisplayHook(session, pub_socket)*
58
59 *sys.displayhook = display_hook*
60
61 *kernel = Kernel(session, reply_socket, pub_socket)*
62
63
64
65
43
66 Qt based GUI
44 Qt based GUI
67 ++++++++++++
45 ++++++++++++
General Comments 0
You need to be logged in to leave comments. Login now