##// END OF EJS Templates
Add missing man pages contributed by Debian's Stephan Peijnik....
Add missing man pages contributed by Debian's Stephan Peijnik. This is an initial import of missing man pages taken verbatim from: http://svn.debian.org/viewsvn/python-modules/packages/ipython/trunk/debian/ This starts to close this bug: https://bugs.launchpad.net/ipython/+bug/291143 I wanted this commit to be purely an import of Stephan's documentation unmodified. I've made some edits to the man pages to update them for 0.10, that will go in the next commit.

File last commit:

r1982:57a94cae
r2098:5d6f848d
Show More
tools.py
89 lines | 2.8 KiB | text/x-python | PythonLexer
Fernando Perez
Ensure that we don't damage the __builtins__ object after %run....
r1955 """Generic testing tools that do NOT depend on Twisted.
In particular, this module exposes a set of top-level assert* functions that
can be used in place of nose.tools.assert* in method generators (the ones in
nose can not, at least as of nose 0.10.4).
Note: our testing package contains testing.util, which does depend on Twisted
and provides utilities for tests that manage Deferreds. All testing support
tools that only depend on nose, IPython or the standard library should go here
instead.
Authors
-------
- Fernando Perez <Fernando.Perez@berkeley.edu>
"""
#*****************************************************************************
# Copyright (C) 2009 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#*****************************************************************************
#-----------------------------------------------------------------------------
# Required modules and packages
#-----------------------------------------------------------------------------
import os
import sys
import nose.tools as nt
from IPython.tools import utils
Brian Granger
Fixing tests in IPython.testing.
r1982 from IPython.testing import decorators as dec
Fernando Perez
Ensure that we don't damage the __builtins__ object after %run....
r1955
#-----------------------------------------------------------------------------
# Globals
#-----------------------------------------------------------------------------
# Make a bunch of nose.tools assert wrappers that can be used in test
# generators. This will expose an assert* function for each one in nose.tools.
_tpl = """
def %(name)s(*a,**kw):
return nt.%(name)s(*a,**kw)
"""
for _x in [a for a in dir(nt) if a.startswith('assert')]:
exec _tpl % dict(name=_x)
#-----------------------------------------------------------------------------
# Functions and classes
#-----------------------------------------------------------------------------
Brian Granger
Fixing tests in IPython.testing.
r1982
Fernando Perez
Ensure that we don't damage the __builtins__ object after %run....
r1955 def full_path(startPath,files):
"""Make full paths for all the listed files, based on startPath.
Only the base part of startPath is kept, since this routine is typically
used with a script's __file__ variable as startPath. The base of startPath
is then prepended to all the listed files, forming the output list.
Brian Granger
Merging Fernando's fixes from his trunk-dev and fixing testing things....
r1973 Parameters
----------
Fernando Perez
Ensure that we don't damage the __builtins__ object after %run....
r1955 startPath : string
Initial path to use as the base for the results. This path is split
using os.path.split() and only its first component is kept.
files : string or list
One or more files.
Brian Granger
Merging Fernando's fixes from his trunk-dev and fixing testing things....
r1973 Examples
--------
Fernando Perez
Ensure that we don't damage the __builtins__ object after %run....
r1955
>>> full_path('/foo/bar.py',['a.txt','b.txt'])
['/foo/a.txt', '/foo/b.txt']
>>> full_path('/foo',['a.txt','b.txt'])
['/a.txt', '/b.txt']
If a single file is given, the output is still a list:
>>> full_path('/foo','a.txt')
['/a.txt']
"""
files = utils.list_strings(files)
base = os.path.split(startPath)[0]
return [ os.path.join(base,f) for f in files ]