Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /leo/plugins/ipython.py

leo
Discussion topic

Back to topic list

CVS update: /leo/plugins/ipython.py

Author vivainio
Full name Ville M. Vainio
Date 2008-02-11 08:11:30 PST
Message User: vivainio
Date: 2008-02-11 08:11:30-0800
Log:
 ipython plugin: remove ipshellembed use (so that only one instance of ipython is launched)
 

File Changes:

Directory: /leo/plugins/
========================

File [changed]: ipython.py
Url: http://leo.tigris.or​g/source/browse/leo/​plugins/ipython.py?r​1=1.8&r2=1.9
Delta lines: +9 -10
--------------------
--- ipython.py 2008-02-05 07:52:30-0800 1.8
+++ ipython.py 2008-02-11 08:11:27-0800 1.9
@@ -63,9 +63,6 @@
 #
 # If it is possible several more settings would be possible.
 #
-# - Improve the get-ipython-results command as Ville suggests by using
-# StringLists.
-#
 # - Allow get-ipython-results to store actual objects using Leo's uA
 # mechanism.
 #@-at
@@ -216,23 +213,25 @@
 
         try:
             c = self.c
- self.ipshell = IPShellEmbed() # Create object to be bound to .api.
+ #self.ipshell = IPShellEmbed() # Create object to be bound to .api.
+
             self.api = api = IPython.ipapi
- self.ip = ip = api.get()
- self.in_list, self.d_out = ip.IP.input_hist, ip.IP.output_hist
             self.message('creating IPython shell...')
             gIPythonStarted = True # Do this *before* calling ipshell.
- c.inCommand = False # Disable the command lockout logic, just as for scripts.
- sys.argv = []
             leox = leoInterface(c,g) # inject leox into the namespace.
             my_ns = { self.leoxName:leox }
- api.launch_new_instance(my_ns)
+ ses = self.api.make_session(my_ns)
+ self.ip = ip = ses.IP.getapi()
+ self.in_list, self.d_out = ip.IP.input_hist, ip.IP.output_hist
+
+ c.inCommand = False # Disable the command lockout logic, just as for scripts.
+ sys.argv = []
+ ses.mainloop()
                 # Does not return until IPython closes!
             # self.ipshell() # This doesn't return until IPython closes!
         except Exception:
             self.error('exception creating IPython shell')
             g.es_exception()
- #@nonl
     #@-node:ekr.20080201​143319.10:startIPyth​on
     #@+node:ekr.20080201​150746.1:getIPythonR​esults
     def getIPythonResults (self,event=None):

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /leo/plugins/ipython.py vivainio Ville M. Vainio 2008-02-11 08:11:30 PST
Messages per page: