Example #1
0
 def __init__(self, parent):
   from logging import getLogger, CRITICAL
   logger=getLogger()
   silenced=None
   for handler in logger.handlers:
     if handler.__class__.__name__=='QtHandler':
       silenced=handler
       old_level=silenced.level
       silenced.setLevel(CRITICAL+1)
       break
   RichIPythonWidget.__init__(self)
   self._parent=parent
   self.buffer_size=10000 # increase buffer size to show longer outputs
   self.set_default_style(colors='linux')
   if IPython.__version__<'1.0':
     kernelapp=IPythonLocalKernelApp.instance()
     kernelapp.initialize()
     self.connect_kernel(connection_file=kernelapp.get_connection_file())
   else:
     kernel_manager=QtInProcessKernelManager(config=self.config, gui='qt4')
     kernel_manager.start_kernel()
     self.kernel_manager=kernel_manager
     self.kernel_client=kernel_manager.client()
     self.kernel_client.start_channels()
   ip=get_ipython()
   # console process exceptions (IPython controlled)
   ip.set_custom_exc((Exception,), ip_excepthook_overwrite)
   self.namespace=ip.user_ns
   self.namespace['IP']=self
   self.namespace['app']=QtGui.QApplication.instance()
   self.namespace['gui']=parent
   self.namespace['plot']=self._plot
   if silenced:
     silenced.setLevel(old_level)
Example #2
0
    def __init__(self, *args, **kwargs):
        """Constructor"""

        RichIPythonWidget.__init__(self, *args, **kwargs)
        self._existing = True
        self._may_close = False
        self._confirm_exit = False
Example #3
0
 def __init__(self, *args, **kwargs):
     """Constructor"""
     
     RichIPythonWidget.__init__(self, *args, **kwargs)
     self._existing = True
     self._may_close = False
     self._confirm_exit = False
Example #4
0
File: ipy.py Project: damantou/moon
 def __init__(self, *args, **kw):
     RichIPythonWidget.__init__(self, *args, **kw)
     self._existing = True
     self._may_close = False
     self._confirm_exit = False
Example #5
0
 def __init__(self, *args, **kw):
     RichIPythonWidget.__init__(self, *args, **kw)
     self._existing = True
     self._may_close = False
     self._confirm_exit = False