From bfc85a9489b5b30e42728fcc1a2dddad92d994a5 2007-05-26 10:20:14 From: vivainio Date: 2007-05-26 10:20:14 Subject: [PATCH] corrected some problematic module interdependencies --- diff --git a/IPython/__init__.py b/IPython/__init__.py index f66508d..2b5035d 100644 --- a/IPython/__init__.py +++ b/IPython/__init__.py @@ -27,7 +27,7 @@ IPython tries to: IPython requires Python 2.3 or newer. -$Id: __init__.py 2393 2007-05-25 18:26:31Z vivainio $""" +$Id: __init__.py 2398 2007-05-26 10:20:14Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez. @@ -48,10 +48,10 @@ import os sys.path.append(os.path.dirname(__file__) + "/Extensions") # Define what gets imported with a 'from IPython import *' -__all__ = ['deep_reload','genutils','ipstruct','ultraTB','DPyGetOpt', +__all__ = ['ipapi','generics','deep_reload','genutils','ipstruct','ultraTB','DPyGetOpt', 'Itpl','hooks','ConfigLoader','OutputTrap','Release','Shell', 'platutils','platutils_win32','platutils_posix','platutils_dummy', - 'ipapi','rlineimpl', 'strdispatch'] + 'rlineimpl', 'strdispatch'] # Load __all__ in IPython namespace so that a simple 'import IPython' gives # access to them via IPython. @@ -59,6 +59,8 @@ glob,loc = globals(),locals() for name in __all__: __import__(name,glob,loc,[]) +import Shell + # Release data from IPython import Release # do it explicitly so pydoc can see it - pydoc bug __author__ = '%s <%s>\n%s <%s>\n%s <%s>' % \ diff --git a/IPython/generics.py b/IPython/generics.py index 9944a45..da471c7 100644 --- a/IPython/generics.py +++ b/IPython/generics.py @@ -1,7 +1,7 @@ from IPython.ipapi import TryNext from IPython.external.simplegeneric import generic -""" 'Generic' functions for extending IPython +''' 'Generic' functions for extending IPython See http://cheeseshop.python.org/pypi/simplegeneric @@ -17,7 +17,7 @@ Here's an example from genutils.py: (Yes, the nasty syntax is for python 2.3 compatibility. Your own extensions can use the niftier decorator syntax) -""" +''' @generic def result_display(result): diff --git a/IPython/genutils.py b/IPython/genutils.py index 6148b72..8cc5ef0 100644 --- a/IPython/genutils.py +++ b/IPython/genutils.py @@ -5,7 +5,7 @@ General purpose utilities. This is a grab-bag of stuff I find useful in most programs I write. Some of these things are also convenient when working at the command line. -$Id: genutils.py 2397 2007-05-26 10:06:26Z vivainio $""" +$Id: genutils.py 2398 2007-05-26 10:20:14Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez. @@ -913,8 +913,6 @@ class LSString(str): p = paths = property(get_paths) - - def print_lsstring(arg): """ Prettier (non-repr-like) and more informative printer for LSString """ print "LSString (.p, .n, .l, .s available). Value:" diff --git a/IPython/ipapi.py b/IPython/ipapi.py index 3f8c304..8a0aca9 100644 --- a/IPython/ipapi.py +++ b/IPython/ipapi.py @@ -65,7 +65,7 @@ import __builtin__ import sys # our own -from IPython.genutils import warn,error +#from IPython.genutils import warn,error class TryNext(Exception): """Try next hook exception. @@ -125,7 +125,7 @@ class IPythonNotRunning: def _dummy_warn(self,*args,**kw): """Dummy function, which doesn't do anything but warn.""" - warn("IPython is not running, this is a dummy no-op function") + print ("IPython is not running, this is a dummy no-op function") def _dummy_silent(self,*args,**kw): """Dummy function, which doesn't do anything and emits no warnings.""" @@ -301,7 +301,7 @@ class IPApi: try: user_ns[name] = eval(name,cf.f_globals,cf.f_locals) except: - error('could not get var. %s from %s' % + print ('could not get var. %s from %s' % (name,cf.f_code.co_name)) def expand_alias(self,line):