~ipython-contrib/ipython/traitlets-rename

« back to all changes in this revision

Viewing changes to IPython/gui/wx/ipshell_nonblocking.py

  • Committer: Dav Clark
  • Date: 2010-01-14 04:02:25 UTC
  • mfrom: (1102.1.220 trunk-dev)
  • Revision ID: davclark@berkeley.edu-20100114040225-dl8eyu6eao2oszra
mergedĀ fromĀ ~fdo.perez/ipython/trunk-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import locale
24
24
from thread_ex import ThreadEx
25
25
 
26
 
try:
27
 
    import IPython
28
 
    from IPython.utils import genutils
29
 
    from IPython.core import iplib
30
 
except Exception,e:
31
 
    print "Error importing IPython (%s)" % str(e)
32
 
    raise Exception, e
 
26
import IPython
 
27
from IPython.core import iplib, ipapp
 
28
from IPython.utils import genutils
33
29
 
34
30
##############################################################################
35
31
class _Helper(object):
155
151
 
156
152
        #Hack to save sys.displayhook, because ipython seems to overwrite it...
157
153
        self.sys_displayhook_ori = sys.displayhook
 
154
 
 
155
        ipython0 = ipapp.IPythonApp(argv,user_ns=user_ns,
 
156
                                    user_global_ns=user_global_ns)
 
157
        ipython0.initialize()
 
158
        self._IP = ipython0.shell
158
159
        
159
 
        self._IP = IPython.shell.make_IPython(
160
 
                                    argv,user_ns=user_ns,
161
 
                                    user_global_ns=user_global_ns,
162
 
                                    embedded=True,
163
 
                                    shell_class=IPython.shell.InteractiveShell)
 
160
        ## self._IP = IPython.shell.make_IPython(
 
161
        ##                             argv,user_ns=user_ns,
 
162
        ##                             user_global_ns=user_global_ns,
 
163
        ##                             embedded=True,
 
164
        ##                             shell_class=IPython.shell.InteractiveShell)
164
165
 
165
166
        #we save ipython0 displayhook and we restore sys.displayhook
166
167
        self.displayhook = sys.displayhook
273
274
        @return: The banner string.
274
275
        @rtype: string
275
276
        """
276
 
        return self._IP.BANNER
 
277
        return self._IP.banner
277
278
    
278
279
    def get_prompt_count(self):
279
280
        """
470
471
        '''
471
472
 
472
473
        orig_stdout = sys.stdout
473
 
        sys.stdout = IPython.shell.Term.cout
 
474
        sys.stdout = genutils.Term.cout
474
475
        #self.sys_displayhook_ori = sys.displayhook
475
476
        #sys.displayhook = self.displayhook
476
477