[IPython-dev] PyMAD/IPython which list updated

Fernando Perez Fernando.Perez at colorado.edu
Wed Mar 23 12:16:13 EST 2005


Frédéric Mantegazza wrote:

> Ok, so there is no way to have obj.method? syntax works the way I want, 
> since IPython will call obj.method.getdoc(), which has no sens...
> 
> In the case a __call__ method is defined, using obj? syntax will print 
> additionnal informations:
> 
> 
>>>>Spectro?
> 
> Type:           instance
> Base Class:     Pyro.core.DynamicProxyWithAttrs
> String Form:    <DynamicProxyWithAttrs for
>                 PYRO://sunceng:7772/c239dc101add619f4fb8359d7176c6d6>
> Namespace:      Interactive
> Docstring:
>     Proxy for Spectrometer.
> 
>     This is a test of docstring.
> Callable:       Yes
> Call def:       Spectro(self, *vargs, **kargs)
> 
> Could it be possible to print the Docstring informations after all other 
> ones ?

I don't understand what you mean here, please be as specific as possible.  Do 
you just want the order to be changed, so docstrings go last?

You could just override getdoc in OInspect, but I have a feeling that some of 
what you want to do is simply impossible.  You'll need to be very clear and 
specific in describing (make up a mock example if you want) _exactly_ what you 
need to do.  Only in that case will I be able to help you further.


>>6.
>>As far as I can see, that's all correct in terms of indentation, and
>>using up-arrow doesn't change any colors.  If you have any problems here,
>>please, instead of trying to describe it, paste the _exact_ output that
>>you get, along with indicating what you think it should be.  There may
>>well be a problem, but I simply don't see any in the cases I've tested
>>(and I cant test your actual prompt, which depends on all sorts of things
>>which are local to your environment).
> 
> 
> The 'problem' occurs only when you have a multi-lineprompt, ie when using 
> one or more '\n' char:
> 
> prompt_in1 '${genutils.getoutput("date")} \n In [\#]: '
> 
> Then, the output is:
> 
> mer mar 23 16:46:29 CET 2005
>  In [1]: for i in xrange(3):
>                                    ...:     print i
>                                    ...:
> 0
> 1
> 2
> 
> For the color problem (sorry, can't repoduce it here !), it only occures on 
> the second line (in fact, the last one) when going up in the history. In 
> the above example, only 'In [' turns to white; not the remaining of the 
> line.
> 
> Well, put this at the end of your todo list, as it is not very important ! 
> I've just made this test to simulate a status bar...

With a proper explanation, the fix was actually trivial.  Checked into CVS, 
let me know if it does what you need.

Best,

f




More information about the IPython-dev mailing list