home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import IPython.ipapi as IPython
- from IPython.genutils import Term
- from IPython.external import pretty
- ip = IPython.ipapi.get()
-
- def pretty_result_display(self, arg):
- if ip.options.pprint:
- verbose = getattr(ip.options, 'pretty_verbose', False)
- out = pretty.pretty(arg, verbose = verbose)
- if '\n' in out:
- Term.cout.write('\n')
-
- print >>Term.cout, out
- else:
- raise TryNext
- return ip.options.pprint
-
- for_type = pretty.for_type
- for_type_by_name = pretty.for_type_by_name
-
- def activate():
- ip.set_hook('result_display', pretty_result_display, priority = 99)
-
-
- def dtype_pprinter(obj, p, cycle):
- if cycle:
- return p.text('dtype(...)')
- if obj.fields is None:
- p.text(repr(obj))
- else:
- p.begin_group(7, 'dtype([')
- for i, field in enumerate(obj.descr):
- if i > 0:
- p.text(',')
- p.breakable()
-
- p.pretty(field)
-
- p.end_group(7, '])')
-
-
- def test_pretty():
- pass
-
-