From e3d7ba5ec02eaf05ec70172f18f814d47ceec8a2 2008-01-19 20:00:49 From: walter.doerwald Date: 2008-01-19 20:00:49 Subject: [PATCH] The input object can now be passed to the constructor of ibrowse/igrid. This makes it possible to use them with objects that implement __or__. --- diff --git a/IPython/Extensions/ibrowse.py b/IPython/Extensions/ibrowse.py index e211e39..bcd693d 100644 --- a/IPython/Extensions/ibrowse.py +++ b/IPython/Extensions/ibrowse.py @@ -796,12 +796,16 @@ class ibrowse(ipipe.Display): keymap.register("refresh", "r") keymap.register("refreshfind", "R") - def __init__(self, *attrs): + def __init__(self, input=None, attrs=None): """ Create a new browser. If ``attrs`` is not empty, it is the list of attributes that will be displayed in the browser, otherwise these will be determined by the objects on screen. """ + self.input = input + + if attrs is None: + attrs = () self.attrs = attrs # Stack of browser levels diff --git a/IPython/Extensions/igrid.py b/IPython/Extensions/igrid.py index 007f3fe..3b50286 100644 --- a/IPython/Extensions/igrid.py +++ b/IPython/Extensions/igrid.py @@ -1101,6 +1101,10 @@ class igrid(ipipe.Display): This is a wx-based display object that can be used instead of ``ibrowse`` (which is curses-based) or ``idump`` (which simply does a print). """ + + def __init__(self, input=None): + self.input = input + if wx.VERSION < (2, 7): def display(self): try: