~ubuntu-branches/ubuntu/raring/ipython/raring

« back to all changes in this revision

Viewing changes to IPython/quarantine/ipy_pydb.py

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2011-11-22 23:40:57 UTC
  • mfrom: (6.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20111122234057-ta86ocdahnhwmnd8
Tags: 0.11-2
* upload to unstable
* add patch fix-version-checks-for-pyzmq-2.1.10.patch
* fix debianize-error-messages.patch to reraise unknown exceptions
* suggest python-zmq for ipython package
* use dh_sphinxdoc
  - bump sphinx dependency to >= 1.0.7+dfsg-1~, replace libjs-jquery
    dependency with ${sphinxdoc:Depends} and drop ipython-doc.links
* remove empty directory from ipython
* link duplicate images in ipython-doc
* remove obsolete Conflicts and Replaces

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import inspect
 
2
from IPython.core import ipapi
 
3
from IPython.utils.process import arg_split
 
4
ip = ipapi.get()
 
5
 
 
6
from IPython.core import debugger
 
7
 
 
8
def call_pydb(self, args):
 
9
    """Invoke pydb with the supplied parameters."""
 
10
    try:
 
11
        import pydb
 
12
    except ImportError:
 
13
        raise ImportError("pydb doesn't seem to be installed.")
 
14
 
 
15
    if not hasattr(pydb.pydb, "runv"):
 
16
        raise ImportError("You need pydb version 1.19 or later installed.")
 
17
 
 
18
    argl = arg_split(args)
 
19
    # print argl # dbg
 
20
    if len(inspect.getargspec(pydb.runv)[0]) == 2:
 
21
        pdb = debugger.Pdb(color_scheme=self.colors)
 
22
        ip.history_saving_wrapper( lambda : pydb.runv(argl, pdb) )()
 
23
    else:
 
24
        ip.history_saving_wrapper( lambda : pydb.runv(argl) )()
 
25
 
 
26
    
 
27
ip.define_magic("pydb",call_pydb)    
 
28
 
 
29
    
 
30
    
 
31