##// END OF EJS Templates
new generic inspect_object
vivainio -
Show More
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Magic functions for InteractiveShell.
2 """Magic functions for InteractiveShell.
3
3
4 $Id: Magic.py 2437 2007-06-14 18:24:38Z vivainio $"""
4 $Id: Magic.py 2464 2007-06-27 23:03:07Z vivainio $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
@@ -58,6 +58,8 b' from IPython.ipstruct import Struct'
58 from IPython.macro import Macro
58 from IPython.macro import Macro
59 from IPython.genutils import *
59 from IPython.genutils import *
60 from IPython import platutils
60 from IPython import platutils
61 import IPython.generics
62 import IPython.ipapi
61
63
62 #***************************************************************************
64 #***************************************************************************
63 # Utility functions
65 # Utility functions
@@ -528,6 +530,7 b' Currently the magic system has the following functions:\\n"""'
528
530
529 #print 'pinfo par: <%s>' % parameter_s # dbg
531 #print 'pinfo par: <%s>' % parameter_s # dbg
530
532
533
531 # detail_level: 0 -> obj? , 1 -> obj??
534 # detail_level: 0 -> obj? , 1 -> obj??
532 detail_level = 0
535 detail_level = 0
533 # We need to detect if we got called as 'pinfo pinfo foo', which can
536 # We need to detect if we got called as 'pinfo pinfo foo', which can
@@ -559,6 +562,11 b' Currently the magic system has the following functions:\\n"""'
559 info = Struct(self._ofind(oname, namespaces))
562 info = Struct(self._ofind(oname, namespaces))
560
563
561 if info.found:
564 if info.found:
565 try:
566 IPython.generics.inspect_object(info.obj)
567 return
568 except IPython.ipapi.TryNext:
569 pass
562 # Get the docstring of the class property if it exists.
570 # Get the docstring of the class property if it exists.
563 path = oname.split('.')
571 path = oname.split('.')
564 root = '.'.join(path[:-1])
572 root = '.'.join(path[:-1])
@@ -25,3 +25,6 b' def result_display(result):'
25
25
26 result_display = generic(result_display)
26 result_display = generic(result_display)
27
27
28 def inspect_object(obj):
29 """ Called when you do obj? """
30 raise TryNext
@@ -12,6 +12,8 b''
12
12
13 In practice, this kind of alias can take the role of a magic function
13 In practice, this kind of alias can take the role of a magic function
14
14
15 * New generic inspect_object, called on obj? and obj??
16
15 2007-06-14 Ville Vainio <vivainio@gmail.com>
17 2007-06-14 Ville Vainio <vivainio@gmail.com>
16
18
17 * iplib.py (handle_auto): Try to use ascii for printing "--->"
19 * iplib.py (handle_auto): Try to use ascii for printing "--->"
General Comments 0
You need to be logged in to leave comments. Login now