##// END OF EJS Templates
Add new commands refresh and refresh_timer (mapped to "R"/"F5"...
Add new commands refresh and refresh_timer (mapped to "R"/"F5" and to the menu) which restarts the iterator once (refresh) or after every x seconds (refresh_timer). Add a working implementation of "searchexpression", where the text entered is not the text to search for, but an expression that must be true. Added display of shortcuts to the menu. Added commands "pickinput" and "pickinputattr" that put the object or attribute under the cursor in the input line. Split the statusbar to be able to display the currently active refresh interval. (Patch by Nik Tautenhahn)

File last commit:

r566:ec81de25
r708:c2a1e430
Show More
FakeModule.py
51 lines | 1.7 KiB | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
"""
Class which mimics a module.
Needed to allow pickle to correctly resolve namespaces during IPython
sessions.
$Id: FakeModule.py 2169 2007-03-23 06:09:43Z fperez $"""
#*****************************************************************************
# Copyright (C) 2002-2004 Fernando Perez. <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#*****************************************************************************
class FakeModule:
"""Simple class with attribute access to fake a module.
This is not meant to replace a module, but to allow inserting a fake
module in sys.modules so that systems which rely on run-time module
importing (like shelve and pickle) work correctly in interactive IPython
sessions.
Do NOT use this code for anything other than this IPython private hack."""
def __init__(self,adict):
# It seems pydoc (and perhaps others) needs any module instance to
# implement a __nonzero__ method, so we add it if missing:
if '__nonzero__' not in adict:
def __nonzero__():
return 1
adict['__nonzero__'] = __nonzero__
self.__dict__ = adict
# modules should have a __file__ attribute
adict.setdefault('__file__',__file__)
def __getattr__(self,key):
try:
return self.__dict__[key]
except KeyError, e:
raise AttributeError("FakeModule object has no attribute %s" % e)
def __str__(self):
return "<IPython.FakeModule instance>"
def __repr__(self):
return str(self)