def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN|wx.WANTS_CHARS, styledef=None, *args, **kwds): """ Create Shell instance. Parameters ----------- styledef : dict, optional styledef is the dictionary of options used to define the style. """ if styledef is not None: self.style = styledef ConsoleWidget.__init__(self, parent, id, pos, size, style) PrefilterFrontEnd.__init__(self, **kwds) # Stick in our own raw_input: self.ipython0.raw_input = self.raw_input # A time for flushing the write buffer BUFFER_FLUSH_TIMER_ID = 100 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID) wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush) if 'debug' in kwds: self.debug = kwds['debug'] kwds.pop('debug') # Inject self in namespace, for debug if self.debug: self.shell.user_ns['self'] = self # Inject our own raw_input in namespace self.shell.user_ns['raw_input'] = self.raw_input
def __init__(self): self.out = StringIO() PrefilterFrontEnd.__init__(self) # Some more code for isolation (yeah, crazy) self._on_enter() self.out.flush() self.out.reset() self.out.truncate()
def __init__(self): self.out = StringIO() PrefilterFrontEnd.__init__(self,argv=default_argv()) # Some more code for isolation (yeah, crazy) self._on_enter() self.out.flush() self.out.reset() self.out.truncate()
def __init__(self, pydev_host, pydev_client_port, *args, **kwargs): PrefilterFrontEnd.__init__(self, *args, **kwargs) # Disable the output trap: we want all that happens to go to the output directly self.shell.output_trap = Null() self._curr_exec_lines = [] self._continuation_prompt = "" # Back channel to PyDev to open editors (in the future other # info may go back this way. This is the same channel that is # used to get stdin, see StdIn in pydev_console_utils) self.ipython0.set_hook("editor", create_editor_hook(pydev_host, pydev_client_port))
def __init__(self, pydev_host, pydev_client_port, *args, **kwargs): PrefilterFrontEnd.__init__(self, *args, **kwargs) # Disable the output trap: we want all that happens to go to the output directly self.shell.output_trap = Null() self._curr_exec_lines = [] self._continuation_prompt = '' # Back channel to PyDev to open editors (in the future other # info may go back this way. This is the same channel that is # used to get stdin, see StdIn in pydev_console_utils) self.ipython0.set_hook( 'editor', create_editor_hook(pydev_host, pydev_client_port))
def __init__(self): ipython0 = get_ipython0().IP self.out = StringIO() PrefilterFrontEnd.__init__(self, ipython0=ipython0) # Clean up the namespace for isolation between tests user_ns = self.ipython0.user_ns # We need to keep references to things so that they don't # get garbage collected (this stinks). self.shadow_ns = dict() for i in self.ipython0.magic_who_ls(): self.shadow_ns[i] = user_ns.pop(i) # Some more code for isolation (yeah, crazy) self._on_enter() self.out.flush() self.out.reset() self.out.truncate()
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.WANTS_CHARS, *args, **kwds): """ Create Shell instance. """ ConsoleWidget.__init__(self, parent, id, pos, size, style) PrefilterFrontEnd.__init__(self, **kwds) # Stick in our own raw_input: self.ipython0.raw_input = self.raw_input # Marker for complete buffer. self.MarkerDefine(_COMPLETE_BUFFER_MARKER, stc.STC_MARK_BACKGROUND, background=_COMPLETE_BUFFER_BG) # Marker for current input buffer. self.MarkerDefine(_INPUT_MARKER, stc.STC_MARK_BACKGROUND, background=_INPUT_BUFFER_BG) # Marker for tracebacks. self.MarkerDefine(_ERROR_MARKER, stc.STC_MARK_BACKGROUND, background=_ERROR_BG) # A time for flushing the write buffer BUFFER_FLUSH_TIMER_ID = 100 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID) wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush) if 'debug' in kwds: self.debug = kwds['debug'] kwds.pop('debug') # Inject self in namespace, for debug if self.debug: self.shell.user_ns['self'] = self # Inject our own raw_input in namespace self.shell.user_ns['raw_input'] = self.raw_input
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.WANTS_CHARS, styledef=None, *args, **kwds): """ Create Shell instance. Parameters ----------- styledef : dict, optional styledef is the dictionary of options used to define the style. """ if styledef is not None: self.style = styledef ConsoleWidget.__init__(self, parent, id, pos, size, style) PrefilterFrontEnd.__init__(self, **kwds) # Stick in our own raw_input: self.ipython0.raw_input = self.raw_input # A time for flushing the write buffer BUFFER_FLUSH_TIMER_ID = 100 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID) wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush) if 'debug' in kwds: self.debug = kwds['debug'] kwds.pop('debug') # Inject self in namespace, for debug if self.debug: self.shell.user_ns['self'] = self # Inject our own raw_input in namespace self.shell.user_ns['raw_input'] = self.raw_input
def __init__( self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.WANTS_CHARS, *args, **kwds ): """ Create Shell instance. """ ConsoleWidget.__init__(self, parent, id, pos, size, style) PrefilterFrontEnd.__init__(self, **kwds) # Stick in our own raw_input: self.ipython0.raw_input = self.raw_input # Marker for complete buffer. self.MarkerDefine(_COMPLETE_BUFFER_MARKER, stc.STC_MARK_BACKGROUND, background=_COMPLETE_BUFFER_BG) # Marker for current input buffer. self.MarkerDefine(_INPUT_MARKER, stc.STC_MARK_BACKGROUND, background=_INPUT_BUFFER_BG) # Marker for tracebacks. self.MarkerDefine(_ERROR_MARKER, stc.STC_MARK_BACKGROUND, background=_ERROR_BG) # A time for flushing the write buffer BUFFER_FLUSH_TIMER_ID = 100 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID) wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush) if "debug" in kwds: self.debug = kwds["debug"] kwds.pop("debug") # Inject self in namespace, for debug if self.debug: self.shell.user_ns["self"] = self # Inject our own raw_input in namespace self.shell.user_ns["raw_input"] = self.raw_input
def __init__(self, *args, **kwargs): PrefilterFrontEnd.__init__(self, *args, **kwargs) #Disable the output trap: we want all that happens to go to the output directly self.shell.output_trap = Null() self._curr_exec_lines = [] self._continuation_prompt = ''