Changeset 2960

Show
Ignore:
Timestamp:
01/19/08 15:52:11 (11 months ago)
Author:
walter.doerwald
Message:

Add an input argument to *all* Display constructors.

Change the ibrowse and other constructors from
init(self, input=None, attrs=None) to
init(self, input=None, *attrs)

Move "import astyle" down as far as possible to avoid
problems wth circular imports.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ipython/trunk/IPython/Extensions/astyle.py

    r1929 r2960  
    267267        for info in self: 
    268268            yield info 
    269     try: 
    270         ipipe.xrepr.when_type(Text)(xrepr_astyle_text) 
    271     except Exception: 
    272         pass 
     269    ipipe.xrepr.when_type(Text)(xrepr_astyle_text) 
    273270 
    274271 
  • ipython/trunk/IPython/Extensions/ibrowse.py

    r2958 r2960  
    797797    keymap.register("refreshfind", "R") 
    798798 
    799     def __init__(self, input=None, attrs=None): 
     799    def __init__(self, input=None, *attrs): 
    800800        """ 
    801801        Create a new browser. If ``attrs`` is not empty, it is the list 
     
    803803        these will be determined by the objects on screen. 
    804804        """ 
    805         self.input = input 
    806  
    807         if attrs is None: 
    808             attrs = () 
     805        ipipe.Display.__init__(self, input) 
     806 
    809807        self.attrs = attrs 
    810808 
  • ipython/trunk/IPython/Extensions/igrid.py

    r2958 r2960  
    11031103    """ 
    11041104 
    1105     def __init__(self, input=None): 
    1106         self.input = input 
    1107  
    11081105    if wx.VERSION < (2, 7): 
    11091106        def display(self): 
    11101107            try: 
    1111                 # Try to create a "standalone" from. If this works we're probably 
     1108                # Try to create a "standalone" frame. If this works we're probably 
    11121109                # running with -wthread. 
    11131110                # Note that this sets the parent of the frame to None, but we can't 
  • ipython/trunk/IPython/Extensions/ipipe.py

    r2689 r2960  
    130130    genutils = None 
    131131    ipapi = None 
    132  
    133 import astyle 
    134132 
    135133 
     
    19331931            return input | self() 
    19341932 
     1933    def __init__(self, input=None): 
     1934        self.input = input 
     1935 
    19351936    def __ror__(self, input): 
    19361937        self.input = input 
     
    20702071 
    20712072 
     2073 
     2074import astyle 
     2075 
    20722076class idump(Display): 
    20732077    # The approximate maximum length of a column entry 
     
    20772081    style_header = astyle.Style.fromstr("white:black:bold") 
    20782082 
    2079     def __init__(self, *attrs): 
     2083    def __init__(self, input=None, *attrs): 
     2084        Display.__init__(self, input) 
    20802085        self.attrs = [upgradexattr(attr) for attr in attrs] 
    20812086        self.headerpadchar = " " 
  • ipython/trunk/doc/ChangeLog

    r2959 r2960  
    112008-01-19  Walter Doerwald  <walter@livinglogic.de> 
    22 
    3     * IPython/Extensions/ibrowse.py, IPython/Extensions/igrid.py: 
    4     The input object can now be passed to the constructor of ibrowse/igrid
     3    * ibrowse.py, igrid.py, ipipe.py: 
     4    The input object can now be passed to the constructor of the display classes
    55    This makes it possible to use them with objects that implement __or__. 
    6  
     6    * ipipe.py: Importing astyle.py is done as late as possible to 
     7    avoid problems with circular imports. 
     8     
    792008-01-19 Ville Vainio  <vivainio@gmail.com> 
    810