本文整理汇总了Python中IPython.frontend.prefilterfrontend.PrefilterFrontEnd.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python PrefilterFrontEnd.__init__方法的具体用法?Python PrefilterFrontEnd.__init__怎么用?Python PrefilterFrontEnd.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPython.frontend.prefilterfrontend.PrefilterFrontEnd
的用法示例。
在下文中一共展示了PrefilterFrontEnd.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import __init__ [as 别名]
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
示例2: __init__
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import __init__ [as 别名]
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()
示例3: __init__
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import __init__ [as 别名]
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))
示例4: __init__
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import __init__ [as 别名]
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()
示例5: __init__
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import __init__ [as 别名]
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
示例6: __init__
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import __init__ [as 别名]
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 = ''