[Scipy-svn] r6900 - in trunk/scipy: fftpack misc

scipy-svn at scipy.org scipy-svn at scipy.org
Sun Nov 14 16:25:55 EST 2010


Author: warren.weckesser
Date: 2010-11-14 15:25:55 -0600 (Sun, 14 Nov 2010)
New Revision: 6900

Removed:
   trunk/scipy/misc/helpmod.py
   trunk/scipy/misc/pexec.py
   trunk/scipy/misc/ppimport.py
Modified:
   trunk/scipy/fftpack/info.py
   trunk/scipy/misc/info.py
Log:
DEP: misc: removed deprecated modules helpdmod, ppimport and pexec (see the 0.8.0 release notes)

Modified: trunk/scipy/fftpack/info.py
===================================================================
--- trunk/scipy/fftpack/info.py	2010-11-14 21:17:52 UTC (rev 6899)
+++ trunk/scipy/fftpack/info.py	2010-11-14 21:25:55 UTC (rev 6900)
@@ -1,4 +1,4 @@
-# This file is executed by __init__.py and ppimport hooks.
+# This file is executed by __init__.py.
 """
 Discrete Fourier transform algorithms
 

Deleted: trunk/scipy/misc/helpmod.py
===================================================================
--- trunk/scipy/misc/helpmod.py	2010-11-14 21:17:52 UTC (rev 6899)
+++ trunk/scipy/misc/helpmod.py	2010-11-14 21:25:55 UTC (rev 6900)
@@ -1,217 +0,0 @@
-import inspect
-import types
-import sys
-import pydoc
-
-import warnings
-warnings.warn('The helpmod module is deprecated. It will be removed from SciPy in version 0.9.',
-              DeprecationWarning)
-
-__all__ = ['info','source']
-
-# NOTE:  pydoc defines a help function which works simliarly to this
-#  except it uses a pager to take over the screen.
-
-# combine name and arguments and split to multiple lines of
-#  width characters.  End lines on a comma and begin argument list
-#  indented with the rest of the arguments.
-def split_line(name, arguments, width):
-    firstwidth = len(name)
-    k = firstwidth
-    newstr = name
-    sepstr = ", "
-    arglist = arguments.split(sepstr)
-    for argument in arglist:
-        if k == firstwidth:
-            addstr = ""
-        else:
-            addstr = sepstr
-        k = k + len(argument) + len(addstr)
-        if k > width:
-            k = firstwidth + 1 + len(argument)
-            newstr = newstr + ",\n" + " "*(firstwidth+2) + argument
-        else:
-            newstr = newstr + addstr + argument
-    return newstr
-
-_namedict = None
-_dictlist = None
-
-# Traverse all module directories underneath globals to see if something is defined
-def makenamedict():
-    import scipy
-    thedict = {'scipy':scipy.__dict__}
-    dictlist = ['scipy']
-    totraverse = [scipy.__dict__]
-    while 1:
-        if len(totraverse) == 0:
-            break
-        thisdict = totraverse.pop(0)
-        for x in thisdict.keys():
-            if isinstance(thisdict[x],types.ModuleType):
-                modname = thisdict[x].__name__
-                if modname not in dictlist:
-                    moddict = thisdict[x].__dict__
-                    dictlist.append(modname)
-                    totraverse.append(moddict)
-                    thedict[modname] = moddict
-    return thedict, dictlist
-
-
-def info(object=None,maxwidth=76,output=sys.stdout,):
-    """Get help information for a function, class, or module.
-
-       Example:
-          >>> from scipy import *
-          >>> info(polyval)
-          polyval(p, x)
-
-            Evaluate the polymnomial p at x.
-
-            Description:
-                If p is of length N, this function returns the value:
-                p[0]*(x**N-1) + p[1]*(x**N-2) + ... + p[N-2]*x + p[N-1]
-    """
-    global _namedict, _dictlist
-
-    if hasattr(object,'_ppimport_importer') or \
-       hasattr(object, '_ppimport_module'):
-        object = object._ppimport_module
-    elif hasattr(object, '_ppimport_attr'):
-        object = object._ppimport_attr
-
-    if object is None:
-        info(info)
-    elif isinstance(object, types.StringType):
-        if _namedict is None:
-            _namedict, _dictlist = makenamedict()
-        numfound = 0
-        objlist = []
-        for namestr in _dictlist:
-            try:
-                obj = _namedict[namestr][object]
-                if id(obj) in objlist:
-                    print >> output, "\n     *** Repeat reference found in %s *** " % namestr
-                else:
-                    objlist.append(id(obj))
-                    print >> output, "     *** Found in %s ***" % namestr
-                    info(obj)
-                    print >> output, "-"*maxwidth
-                numfound += 1
-            except KeyError:
-                pass
-        if numfound == 0:
-            print >> output, "Help for %s not found." % object
-        else:
-            print >> output, "\n     *** Total of %d references found. ***" % numfound
-
-    elif inspect.isfunction(object):
-        name = object.func_name
-        arguments = apply(inspect.formatargspec, inspect.getargspec(object))
-
-        if len(name+arguments) > maxwidth:
-            argstr = split_line(name, arguments, maxwidth)
-        else:
-            argstr = name + arguments
-
-        print >> output, " " + argstr + "\n"
-        print >> output, inspect.getdoc(object)
-
-    elif inspect.isclass(object):
-        name = object.__name__
-        if hasattr(object, '__init__'):
-            arguments = apply(inspect.formatargspec, inspect.getargspec(object.__init__.im_func))
-            arglist = arguments.split(', ')
-            if len(arglist) > 1:
-                arglist[1] = "("+arglist[1]
-                arguments = ", ".join(arglist[1:])
-            else:
-                arguments = "()"
-        else:
-            arguments = "()"
-
-        if len(name+arguments) > maxwidth:
-            argstr = split_line(name, arguments, maxwidth)
-        else:
-            argstr = name + arguments
-
-        print >> output, " " + argstr + "\n"
-        doc1 = inspect.getdoc(object)
-        if doc1 is None:
-            if hasattr(object,'__init__'):
-                print >> output, inspect.getdoc(object.__init__)
-        else:
-            print >> output, inspect.getdoc(object)
-
-        methods = pydoc.allmethods(object)
-        if methods != []:
-            print >> output, "\n\nMethods:\n"
-            for meth in methods:
-                if meth[0] == '_':
-                    continue
-                thisobj = getattr(object, meth, None)
-                if thisobj is not None:
-                    methstr, other = pydoc.splitdoc(inspect.getdoc(thisobj) or "None")
-                print >> output, "  %s  --  %s" % (meth, methstr)
-
-    elif type(object) is types.InstanceType: ## check for __call__ method
-        print >> output, "Instance of class: ", object.__class__.__name__
-        print >> output
-        if hasattr(object, '__call__'):
-            arguments = apply(inspect.formatargspec, inspect.getargspec(object.__call__.im_func))
-            arglist = arguments.split(', ')
-            if len(arglist) > 1:
-                arglist[1] = "("+arglist[1]
-                arguments = ", ".join(arglist[1:])
-            else:
-                arguments = "()"
-
-            if hasattr(object,'name'):
-                name = "%s" % object.name
-            else:
-                name = "<name>"
-            if len(name+arguments) > maxwidth:
-                argstr = split_line(name, arguments, maxwidth)
-            else:
-                argstr = name + arguments
-
-            print >> output, " " + argstr + "\n"
-            doc = inspect.getdoc(object.__call__)
-            if doc is not None:
-                print >> output, inspect.getdoc(object.__call__)
-            print >> output, inspect.getdoc(object)
-
-        else:
-            print >> output, inspect.getdoc(object)
-
-    elif inspect.ismethod(object):
-        name = object.__name__
-        arguments = apply(inspect.formatargspec, inspect.getargspec(object.im_func))
-        arglist = arguments.split(', ')
-        if len(arglist) > 1:
-            arglist[1] = "("+arglist[1]
-            arguments = ", ".join(arglist[1:])
-        else:
-            arguments = "()"
-
-        if len(name+arguments) > maxwidth:
-            argstr = split_line(name, arguments, maxwidth)
-        else:
-            argstr = name + arguments
-
-        print >> output, " " + argstr + "\n"
-        print >> output, inspect.getdoc(object)
-
-    elif hasattr(object, '__doc__'):
-        print >> output, inspect.getdoc(object)
-
-
-
-def source(object, output=sys.stdout):
-    """Write source for this object to output.
-    """
-    try:
-        print >> output,  "In file: %s\n" % inspect.getsourcefile(object)
-        print >> output,  inspect.getsource(object)
-    except:
-        print >> output,  "Not available for this object."

Modified: trunk/scipy/misc/info.py
===================================================================
--- trunk/scipy/misc/info.py	2010-11-14 21:17:52 UTC (rev 6899)
+++ trunk/scipy/misc/info.py	2010-11-14 21:25:55 UTC (rev 6900)
@@ -12,10 +12,7 @@
 
    common     - Common functions requiring SciPy Base and Level 1 SciPy
    doccer     - Docstring fragment insertion utilities
-   helpmod    -
-   pexec      -
    pilutil    - Image utilities using the Python Imaging Library (PIL)
-   ppimport   - Postpone module import to future
    setup      -
    setupscons -
 

Deleted: trunk/scipy/misc/pexec.py
===================================================================
--- trunk/scipy/misc/pexec.py	2010-11-14 21:17:52 UTC (rev 6899)
+++ trunk/scipy/misc/pexec.py	2010-11-14 21:25:55 UTC (rev 6900)
@@ -1,64 +0,0 @@
-#
-# Title: Provides ParallelExec to execute commands in
-#        other (background or parallel) threads.
-# Author: Pearu Peteson <pearu at cens.ioc.ee>
-# Created: October, 2003
-#
-
-__all__ = ['ParallelExec']
-
-import sys
-import threading
-import Queue
-import traceback
-
-import warnings
-warnings.warn('The pexec module is deprecated. It will be removed from SciPy in version 0.9.',
-              DeprecationWarning)
-
-
-class ParallelExec(threading.Thread):
-    """ Create a thread of parallel execution.
-    """
-    def __init__(self):
-        threading.Thread.__init__(self)
-        self.__queue = Queue.Queue(0)
-        self.__frame = sys._getframe(1)
-        self.setDaemon(1)
-        self.start()
-
-    def __call__(self,code,frame=None,wait=0):
-        """ Execute code in parallel thread inside given frame (default
-        frame is where this instance was created).
-        If wait is True then __call__ returns after code is executed,
-        otherwise code execution happens in background.
-        """
-        if wait:
-            wait_for_code = threading.Event()
-        else:
-            wait_for_code = None
-        self.__queue.put((code,frame,wait_for_code))
-        if wait:
-            wait_for_code.wait()
-
-    def shutdown(self):
-        """ Shutdown parallel thread."""
-        self.__queue.put((None,None,None))
-
-    def run(self):
-        """ Called by threading.Thread."""
-        while 1:
-            code, frame, wait_for_code = self.__queue.get()
-            if code is None:
-                break
-            if frame is None:
-                frame = self.__frame
-            try:
-                exec (code, frame.f_globals,frame.f_locals)
-            except Exception:
-                try:
-                    traceback.print_exc()
-                except AttributeError:
-                    pass
-            if wait_for_code is not None:
-                wait_for_code.set()

Deleted: trunk/scipy/misc/ppimport.py
===================================================================
--- trunk/scipy/misc/ppimport.py	2010-11-14 21:17:52 UTC (rev 6899)
+++ trunk/scipy/misc/ppimport.py	2010-11-14 21:25:55 UTC (rev 6900)
@@ -1,444 +0,0 @@
-#!/usr/bin/env python
-"""
-Postpone module import to future.
-
-Python versions: 1.5.2 - 2.3.x
-Author: Pearu Peterson <pearu at cens.ioc.ee>
-Created: March 2003
-$Revision: 922 $
-$Date: 2004-11-27 14:23:27 -0700 (Sat, 27 Nov 2004) $
-"""
-__all__ = ['ppimport','ppimport_attr','ppresolve']
-
-import os
-import sys
-import types
-import traceback
-
-import warnings
-warnings.warn('The ppimport module is deprecated. It will be removed from SciPy in version 0.9.',
-              DeprecationWarning)
-
-DEBUG=0
-
-_ppimport_is_enabled = 1
-def enable():
-    """ Enable postponed importing."""
-    global _ppimport_is_enabled
-    _ppimport_is_enabled = 1
-
-def disable():
-    """ Disable postponed importing."""
-    global _ppimport_is_enabled
-    _ppimport_is_enabled = 0
-
-class PPImportError(ImportError):
-    pass
-
-def _get_so_ext(_cache={}):
-    so_ext = _cache.get('so_ext')
-    if so_ext is None:
-        if sys.platform[:5]=='linux':
-            so_ext = '.so'
-        else:
-            try:
-                # if possible, avoid expensive get_config_vars call
-                from distutils.sysconfig import get_config_vars
-                so_ext = get_config_vars('SO')[0] or ''
-            except ImportError:
-                #XXX: implement hooks for .sl, .dll to fully support
-                #     Python 1.5.x
-                so_ext = '.so'
-        _cache['so_ext'] = so_ext
-    return so_ext
-
-def _get_frame(level=0):
-    try:
-        return sys._getframe(level+1)
-    except AttributeError:
-        # Python<=2.0 support
-        frame = sys.exc_info()[2].tb_frame
-        for i in range(level+1):
-            frame = frame.f_back
-        return frame
-
-def ppimport_attr(module, name):
-    """ ppimport(module, name) is 'postponed' getattr(module, name)
-    """
-    global _ppimport_is_enabled
-    if _ppimport_is_enabled and isinstance(module, _ModuleLoader):
-        return _AttrLoader(module, name)
-    return getattr(module, name)
-
-class _AttrLoader(object):
-    def __init__(self, module, name):
-        self.__dict__['_ppimport_attr_module'] = module
-        self.__dict__['_ppimport_attr_name'] = name
-
-    def _ppimport_attr_getter(self):
-        module = self.__dict__['_ppimport_attr_module']
-        if isinstance(module, _ModuleLoader):
-            # in case pp module was loaded by other means
-            module = sys.modules[module.__name__]
-        attr = getattr(module,
-                       self.__dict__['_ppimport_attr_name'])
-        try:
-            d = attr.__dict__
-            if d is not None:
-                self.__dict__ = d
-        except AttributeError:
-            pass
-        self.__dict__['_ppimport_attr'] = attr
-
-        return attr
-
-    def __nonzero__(self):
-        return 1
-
-    def __getattr__(self, name):
-        try:
-            attr = self.__dict__['_ppimport_attr']
-        except KeyError:
-            attr = self._ppimport_attr_getter()
-        if name=='_ppimport_attr':
-            return attr
-        return getattr(attr, name)
-
-    def __repr__(self):
-        if '_ppimport_attr' in self.__dict__:
-            return repr(self._ppimport_attr)
-        module = self.__dict__['_ppimport_attr_module']
-        name = self.__dict__['_ppimport_attr_name']
-        return "<attribute %s of %s>" % (`name`,`module`)
-
-    __str__ = __repr__
-
-    # For function and class attributes.
-    def __call__(self, *args, **kwds):
-        return self._ppimport_attr(*args,**kwds)
-
-
-
-def _is_local_module(p_dir,name,suffices):
-    base = os.path.join(p_dir,name)
-    for suffix in suffices:
-        if os.path.isfile(base+suffix):
-            if p_dir:
-                return base+suffix
-            return name+suffix
-
-def ppimport(name):
-    """ ppimport(name) -> module or module wrapper
-
-    If name has been imported before, return module. Otherwise
-    return ModuleLoader instance that transparently postpones
-    module import until the first attempt to access module name
-    attributes.
-    """
-    global _ppimport_is_enabled
-
-    level = 1
-    parent_frame = p_frame = _get_frame(level)
-    while '__name__' not in p_frame.f_locals:
-        level = level + 1
-        p_frame = _get_frame(level)
-
-    p_name = p_frame.f_locals['__name__']
-    if p_name=='__main__':
-        p_dir = ''
-        fullname = name
-    elif '__path__' in p_frame.f_locals:
-        # python package
-        p_path = p_frame.f_locals['__path__']
-        p_dir = p_path[0]
-        fullname = p_name + '.' + name
-    else:
-        # python module
-        p_file = p_frame.f_locals['__file__']
-        p_dir = os.path.dirname(p_file)
-        fullname = p_name + '.' + name
-
-    # module may be imported already
-    module = sys.modules.get(fullname)
-    if module is not None:
-        if _ppimport_is_enabled or isinstance(module, types.ModuleType):
-            return module
-        return module._ppimport_importer()
-
-    so_ext = _get_so_ext()
-    py_exts = ('.py','.pyc','.pyo')
-    so_exts = (so_ext,'module'+so_ext)
-
-    for d,n,fn,e in [\
-        # name is local python module or local extension module
-        (p_dir, name, fullname, py_exts+so_exts),
-        # name is local package
-        (os.path.join(p_dir, name), '__init__', fullname, py_exts),
-        # name is package in parent directory (scipy specific)
-        (os.path.join(os.path.dirname(p_dir), name), '__init__', name, py_exts),
-        ]:
-        location = _is_local_module(d, n, e)
-        if location is not None:
-            fullname = fn
-            break
-
-    if location is None:
-        # name is to be looked in python sys.path.
-        fullname = name
-        location = 'sys.path'
-
-    # Try once more if module is imported.
-    # This covers the case when importing from python module
-    module = sys.modules.get(fullname)
-
-    if module is not None:
-        if _ppimport_is_enabled or isinstance(module,types.ModuleType):
-            return module
-        return module._ppimport_importer()
-    # It is OK if name does not exists. The ImportError is
-    # postponed until trying to use the module.
-
-    loader = _ModuleLoader(fullname,location,p_frame=parent_frame)
-    if _ppimport_is_enabled:
-        return loader
-
-    return loader._ppimport_importer()
-
-def _get_frame_code(frame):
-    filename = frame.f_code.co_filename
-    lineno = frame.f_lineno
-    result = '%s in %s:\n' % (filename,frame.f_code.co_name)
-    if not os.path.isfile(filename):
-        return result
-    f = open(filename)
-    i = 1
-    line = f.readline()
-    while line:
-        line = f.readline()
-        i = i + 1
-        if (abs(i-lineno)<2):
-            result += '#%d: %s\n' % (i,line.rstrip())
-        if i>lineno+3:
-            break
-    f.close()
-    return result
-
-def frame_traceback(frame):
-    if not frame:
-        return
-    blocks = []
-    f = frame
-    while f:
-        blocks.insert(0,_get_frame_code(f))
-        f = f.f_back
-    print '='*50
-    print '\n'.join(blocks)
-    print '='*50
-
-class _ModuleLoader(object):
-    # Don't use it directly. Use ppimport instead.
-
-    def __init__(self,name,location,p_frame=None):
-
-        # set attributes, avoid calling __setattr__
-        self.__dict__['__name__'] = name
-        self.__dict__['__file__'] = location
-        self.__dict__['_ppimport_p_frame'] = p_frame
-
-        if location != 'sys.path':
-            from numpy.testing import Tester
-            self.__dict__['test'] = Tester(os.path.dirname(location)).test
-
-        # install loader
-        sys.modules[name] = self
-
-    def _ppimport_importer(self):
-        name = self.__name__
-
-        try:
-            module = sys.modules[name]
-        except KeyError:
-            raise ImportError,self.__dict__.get('_ppimport_exc_info')[1]
-        if module is not self:
-            exc_info = self.__dict__.get('_ppimport_exc_info')
-            if exc_info is not None:
-                raise PPImportError,\
-                      ''.join(traceback.format_exception(*exc_info))
-            else:
-                assert module is self,`(module, self)`
-
-        # uninstall loader
-        del sys.modules[name]
-
-        if DEBUG:
-            print 'Executing postponed import for %s' %(name)
-        try:
-            module = __import__(name,None,None,['*'])
-        except Exception,msg: # ImportError:
-            if DEBUG:
-                p_frame = self.__dict__.get('_ppimport_p_frame',None)
-                frame_traceback(p_frame)
-            self.__dict__['_ppimport_exc_info'] = sys.exc_info()
-            raise
-
-        assert isinstance(module,types.ModuleType),`module`
-
-        self.__dict__ = module.__dict__
-        self.__dict__['_ppimport_module'] = module
-
-        # XXX: Should we check the existence of module.test? Warn?
-        from numpy.testing import Tester
-        test = Tester(os.path.dirname(module)).test
-        return module
-
-    def __setattr__(self, name, value):
-        try:
-            module = self.__dict__['_ppimport_module']
-        except KeyError:
-            module = self._ppimport_importer()
-        return setattr(module, name, value)
-
-    def __getattr__(self, name):
-        try:
-            module = self.__dict__['_ppimport_module']
-        except KeyError:
-            module = self._ppimport_importer()
-        return getattr(module, name)
-
-    def __repr__(self):
-        global _ppimport_is_enabled
-        if not _ppimport_is_enabled:
-            try:
-                module = self.__dict__['_ppimport_module']
-            except KeyError:
-                module = self._ppimport_importer()
-            return module.__repr__()
-        if '_ppimport_module' in self.__dict__:
-            status = 'imported'
-        elif '_ppimport_exc_info' in self.__dict__:
-            status = 'import error'
-        else:
-            status = 'import postponed'
-        return '<module %s from %s [%s]>' \
-               % (`self.__name__`,`self.__file__`, status)
-
-    __str__ = __repr__
-
-def ppresolve(a,ignore_failure=None):
-    """ Return resolved object a.
-
-    a can be module name, postponed module, postponed modules
-    attribute, string representing module attribute, or any
-    Python object.
-    """
-    global _ppimport_is_enabled
-    if _ppimport_is_enabled:
-        disable()
-        a = ppresolve(a,ignore_failure=ignore_failure)
-        enable()
-        return a
-    if type(a) is type(''):
-        ns = a.split('.')
-        if ignore_failure:
-            try:
-                a = ppimport(ns[0])
-            except:
-                return a
-        else:
-            a = ppimport(ns[0])
-        b = [ns[0]]
-        del ns[0]
-        while ns:
-            if hasattr(a,'_ppimport_importer') or \
-                   hasattr(a,'_ppimport_module'):
-                a = getattr(a,'_ppimport_module',a)
-            if hasattr(a,'_ppimport_attr'):
-                a = a._ppimport_attr
-            b.append(ns[0])
-            del ns[0]
-            if ignore_failure and not hasattr(a, b[-1]):
-                a = '.'.join(ns+b)
-                b = '.'.join(b)
-                if b in sys.modules and sys.modules[b] is None:
-                    del sys.modules[b]
-                return a
-            a = getattr(a,b[-1])
-    if hasattr(a,'_ppimport_importer') or \
-           hasattr(a,'_ppimport_module'):
-        a = getattr(a,'_ppimport_module',a)
-    if hasattr(a,'_ppimport_attr'):
-        a = a._ppimport_attr
-    return a
-
-def _ppresolve_ignore_failure(a):
-    return ppresolve(a,ignore_failure=1)
-
-try:
-    import pydoc as _pydoc
-except ImportError:
-    _pydoc = None
-
-if _pydoc is not None:
-    # Redefine __call__ method of help.__class__ to
-    # support ppimport.
-    import new as _new
-
-    _old_pydoc_help_call = _pydoc.help.__class__.__call__
-    def _ppimport_pydoc_help_call(self,*args,**kwds):
-        return _old_pydoc_help_call(self, *map(_ppresolve_ignore_failure,args),
-                                    **kwds)
-    _ppimport_pydoc_help_call.__doc__ = _old_pydoc_help_call.__doc__
-    _pydoc.help.__class__.__call__ = _new.instancemethod(_ppimport_pydoc_help_call,
-                                                         None,
-                                                         _pydoc.help.__class__)
-
-    _old_pydoc_Doc_document = _pydoc.Doc.document
-    def _ppimport_pydoc_Doc_document(self,*args,**kwds):
-        args = (_ppresolve_ignore_failure(args[0]),) + args[1:]
-        return _old_pydoc_Doc_document(self,*args,**kwds)
-    _ppimport_pydoc_Doc_document.__doc__ = _old_pydoc_Doc_document.__doc__
-    _pydoc.Doc.document = _new.instancemethod(_ppimport_pydoc_Doc_document,
-                                              None,
-                                              _pydoc.Doc)
-
-    _old_pydoc_describe = _pydoc.describe
-    def _ppimport_pydoc_describe(object):
-        return _old_pydoc_describe(_ppresolve_ignore_failure(object))
-    _ppimport_pydoc_describe.__doc__ = _old_pydoc_describe.__doc__
-    _pydoc.describe = _ppimport_pydoc_describe
-
-import inspect as _inspect
-_old_inspect_getfile = _inspect.getfile
-def _ppimport_inspect_getfile(object):
-    if isinstance(object,_ModuleLoader):
-        return object.__dict__['__file__']
-    return _old_inspect_getfile(_ppresolve_ignore_failure(object))
-_ppimport_inspect_getfile.__doc__ = _old_inspect_getfile.__doc__
-_inspect.getfile = _ppimport_inspect_getfile
-
-_old_inspect_getdoc = _inspect.getdoc
-def _ppimport_inspect_getdoc(object):
-    return _old_inspect_getdoc(_ppresolve_ignore_failure(object))
-_ppimport_inspect_getdoc.__doc__ = _old_inspect_getdoc.__doc__
-_inspect.getdoc = _ppimport_inspect_getdoc
-
-_old_inspect_getsource = _inspect.getsource
-def _ppimport_inspect_getsource(object):
-    return _old_inspect_getsource(_ppresolve_ignore_failure(object))
-_ppimport_inspect_getsource.__doc__ = _old_inspect_getsource.__doc__
-_inspect.getsource = _ppimport_inspect_getsource
-
-import __builtin__ as _builtin
-_old_builtin_dir = _builtin.dir
-def _ppimport_builtin_dir(*arg):
-    if not arg:
-        p_frame = _get_frame(1)
-        g = p_frame.f_globals
-        l = p_frame.f_locals
-        l['_ppimport_old_builtin_dir'] = _old_builtin_dir
-        r = eval('_ppimport_old_builtin_dir()',g,l)
-        del r[r.index('_ppimport_old_builtin_dir')]
-        return r
-    return _old_builtin_dir(*map(_ppresolve_ignore_failure,arg))
-_ppimport_builtin_dir.__doc__ = _old_builtin_dir.__doc__
-_builtin.dir = _ppimport_builtin_dir




More information about the Scipy-svn mailing list