##// END OF EJS Templates
fix mkdir in ipy_fsops.collect
fix mkdir in ipy_fsops.collect

File last commit:

r738:73956253
r828:1b133374
Show More
generics.py
30 lines | 857 B | text/x-python | PythonLexer
vivainio
Add generics.py, result_display generic, first impl is LSString result printer
r694 from IPython.ipapi import TryNext
from IPython.external.simplegeneric import generic
vivainio
corrected some problematic module interdependencies
r695 ''' 'Generic' functions for extending IPython
vivainio
Add generics.py, result_display generic, first impl is LSString result printer
r694
See http://cheeseshop.python.org/pypi/simplegeneric
Here's an example from genutils.py:
def print_lsstring(arg):
""" Prettier (non-repr-like) and more informative printer for LSString """
print "LSString (.p, .n, .l, .s available). Value:"
print arg
print_lsstring = result_display.when_type(LSString)(print_lsstring)
(Yes, the nasty syntax is for python 2.3 compatibility. Your own extensions
can use the niftier decorator syntax)
vivainio
corrected some problematic module interdependencies
r695 '''
vivainio
Add generics.py, result_display generic, first impl is LSString result printer
r694
def result_display(result):
""" print the result of computation """
raise TryNext
result_display = generic(result_display)
vivainio
new generic inspect_object
r738 def inspect_object(obj):
""" Called when you do obj? """
raise TryNext