Logo Search packages:      
Sourcecode: ipython version File versions  Download package

def IPython::Debugger::Tracer::__init__ (   self,
  colors = None 
)

Create a local debugger instance.

:Parameters:

  - `colors` (None): a string containing the name of the color scheme to
use, it must be one of IPython's valid color schemes.  If not given, the
function will default to the current IPython scheme when running inside
IPython, and to 'NoColor' otherwise.

Usage example:

from IPython.Debugger import Tracer; debug_here = Tracer()

... later in your code
debug_here()  # -> will open up the debugger at that point.

Once the debugger activates, you can use all of its regular commands to
step through code, set breakpoints, etc.  See the pdb documentation
from the Python standard library for usage details.

Definition at line 84 of file Debugger.py.

00084                                   :
        """Create a local debugger instance.

        :Parameters:

          - `colors` (None): a string containing the name of the color scheme to
        use, it must be one of IPython's valid color schemes.  If not given, the
        function will default to the current IPython scheme when running inside
        IPython, and to 'NoColor' otherwise.

        Usage example:

        from IPython.Debugger import Tracer; debug_here = Tracer()

        ... later in your code
        debug_here()  # -> will open up the debugger at that point.

        Once the debugger activates, you can use all of its regular commands to
        step through code, set breakpoints, etc.  See the pdb documentation
        from the Python standard library for usage details.
        """

        global __IPYTHON__
        try:
            __IPYTHON__
        except NameError:
            # Outside of ipython, we set our own exception hook manually
            __IPYTHON__ = ipapi.get(True,False)
            BdbQuit_excepthook.excepthook_ori = sys.excepthook
            sys.excepthook = BdbQuit_excepthook
            def_colors = 'NoColor'
            try:
                # Limited tab completion support
                import rlcompleter,readline
                readline.parse_and_bind('tab: complete')
            except ImportError:
                pass
        else:
            # In ipython, we use its custom exception handler mechanism
            ip = ipapi.get()
            def_colors = ip.options.colors
            ip.set_custom_exc((bdb.BdbQuit,),BdbQuit_IPython_excepthook)

        if colors is None:
            colors = def_colors
        self.debugger = Pdb(colors)

    def __call__(self):


Generated by  Doxygen 1.6.0   Back to index