##// END OF EJS Templates
* IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail...
* IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail and make it iterable (iterating over the attribute itself). Add two new magic strings for __xattrs__(): If the string starts with "-", the attribute will not be displayed in ibrowse's detail view (but it can still be iterated over). This makes it possible to add attributes that are large lists or generator methods to the detail view. Replace magic attribute names and _attrname() and _getattr() with "descriptors": For each type of magic attribute name there's a subclass of Descriptor: None -> SelfDescriptor(); "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo"); "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo"); foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__() are still supported. * IPython/Extensions/ibrowse.py: If fetching the next row from the input fails in ibrowse.fetch(), the exception object is added as the last item and item fetching is canceled. This prevents ibrowse from aborting if e.g. a generator throws an exception midway through execution. * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and encoding into methods.

File last commit:

r0:6f629fcc
r355:9c312a73
Show More
nbexample_output.py
20 lines | 642 B | text/x-python | PythonLexer
/ doc / nbexample_output.py
from notebook.markup import rest
rest.title('This is a Python Notebook')
rest.text("""\
Some plain text, without any special formatting.
Below, we define a simple function to add two numbers.""")
def add(x,y):
return x+y
rest.text("Let's use it with x=2,y=3:")
# This simply means that all code until the next markup call is to be executed
# as a single call. The editing screen should mark the whole group of lines
# with a single In[NN] tag (like IPython does, but with multi-line capabilities)
rest.input()
add(2,3)
# This output would appear on-screen (in the editing window) simply marked
# with an Out[NN] tag
rest.output("5")