Exemple #1
0
        def __init__(self,color_scheme='NoColor',completekey=None,
                     stdin=None, stdout=None):

            # Parent constructor:
            if has_pydb and completekey is None:
                OldPdb.__init__(self,stdin=stdin,stdout=Term.cout)
            else:
                OldPdb.__init__(self,completekey,stdin,stdout)
                
            self.prompt = prompt # The default prompt is '(Pdb)'
            
            # IPython changes...
            self.is_pydb = has_pydb

            if self.is_pydb:

                # iplib.py's ipalias seems to want pdb's checkline
                # which located in pydb.fn
                import pydb.fns
                self.checkline = lambda filename, lineno: \
                                 pydb.fns.checkline(self, filename, lineno)

                self.curframe = None
                self.do_restart = self.new_do_restart

                self.old_all_completions = __IPYTHON__.Completer.all_completions
                __IPYTHON__.Completer.all_completions=self.all_completions

                self.do_list = decorate_fn_with_doc(self.list_command_pydb,
                                                    OldPdb.do_list)
                self.do_l     = self.do_list
                self.do_frame = decorate_fn_with_doc(self.new_do_frame,
                                                     OldPdb.do_frame)

            self.aliases = {}

            # Create color table: we copy the default one from the traceback
            # module and add a few attributes needed for debugging
            self.color_scheme_table = exception_colors()

            # shorthands 
            C = ColorANSI.TermColors
            cst = self.color_scheme_table

            cst['NoColor'].colors.breakpoint_enabled = C.NoColor
            cst['NoColor'].colors.breakpoint_disabled = C.NoColor

            cst['Linux'].colors.breakpoint_enabled = C.LightRed
            cst['Linux'].colors.breakpoint_disabled = C.Red

            cst['LightBG'].colors.breakpoint_enabled = C.LightRed
            cst['LightBG'].colors.breakpoint_disabled = C.Red

            self.set_colors(color_scheme)

            # Add a python parser so we can syntax highlight source while
            # debugging.
            self.parser = PyColorize.Parser()
Exemple #2
0
    def __init__(self,color_scheme = 'NoColor',call_pdb=False):
        # Whether to call the interactive pdb debugger after printing
        # tracebacks or not
        self.call_pdb = call_pdb

        self.color_scheme_table = exception_colors()

        self.set_colors(color_scheme)
        self.old_scheme = color_scheme  # save initial value for toggles

        if call_pdb:
            self.pdb = Debugger.Pdb(self.color_scheme_table.active_scheme_name)
        else:
            self.pdb = None
Exemple #3
0
    def __init__(self, color_scheme='NoColor', call_pdb=False):
        # Whether to call the interactive pdb debugger after printing
        # tracebacks or not
        self.call_pdb = call_pdb

        # Create color table
        self.color_scheme_table = exception_colors()

        self.set_colors(color_scheme)
        self.old_scheme = color_scheme  # save initial value for toggles

        if call_pdb:
            self.pdb = Debugger.Pdb(self.color_scheme_table.active_scheme_name)
        else:
            self.pdb = None
Exemple #4
0
        def __init__(self,color_scheme='NoColor'):
            bdb.Bdb.__init__(self)
            cmd.Cmd.__init__(self,completekey=None) # don't load readline
            self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
            self.aliases = {}

            # These two lines are part of the py2.4 constructor, let's put them
            # unconditionally here as they won't cause any problems in 2.3.
            self.mainpyfile = ''
            self._wait_for_mainpyfile = 0

            # Read $HOME/.pdbrc and ./.pdbrc
            try:
                self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
                                                        ".pdbrc"))
            except KeyError:
                self.rcLines = []
            self.rcLines.extend(_file_lines(".pdbrc"))

            # Create color table: we copy the default one from the traceback
            # module and add a few attributes needed for debugging
            self.color_scheme_table = exception_colors()

            # shorthands 
            C = ColorANSI.TermColors
            cst = self.color_scheme_table

            cst['NoColor'].colors.breakpoint_enabled = C.NoColor
            cst['NoColor'].colors.breakpoint_disabled = C.NoColor

            cst['Linux'].colors.breakpoint_enabled = C.LightRed
            cst['Linux'].colors.breakpoint_disabled = C.Red

            cst['LightBG'].colors.breakpoint_enabled = C.LightRed
            cst['LightBG'].colors.breakpoint_disabled = C.Red

            self.set_colors(color_scheme)

            # Add a python parser so we can syntax highlight source while
            # debugging.
            self.parser = PyColorize.Parser()
Exemple #5
0
        def __init__(self, color_scheme='NoColor'):
            bdb.Bdb.__init__(self)
            cmd.Cmd.__init__(self, completekey=None)  # don't load readline
            self.prompt = 'ipdb> '  # The default prompt is '(Pdb)'
            self.aliases = {}

            # These two lines are part of the py2.4 constructor, let's put them
            # unconditionally here as they won't cause any problems in 2.3.
            self.mainpyfile = ''
            self._wait_for_mainpyfile = 0

            # Read $HOME/.pdbrc and ./.pdbrc
            try:
                self.rcLines = _file_lines(
                    os.path.join(os.environ['HOME'], ".pdbrc"))
            except KeyError:
                self.rcLines = []
            self.rcLines.extend(_file_lines(".pdbrc"))

            # Create color table: we copy the default one from the traceback
            # module and add a few attributes needed for debugging
            self.color_scheme_table = exception_colors()

            # shorthands
            C = ColorANSI.TermColors
            cst = self.color_scheme_table

            cst['NoColor'].colors.breakpoint_enabled = C.NoColor
            cst['NoColor'].colors.breakpoint_disabled = C.NoColor

            cst['Linux'].colors.breakpoint_enabled = C.LightRed
            cst['Linux'].colors.breakpoint_disabled = C.Red

            cst['LightBG'].colors.breakpoint_enabled = C.LightRed
            cst['LightBG'].colors.breakpoint_disabled = C.Red

            self.set_colors(color_scheme)

            # Add a python parser so we can syntax highlight source while
            # debugging.
            self.parser = PyColorize.Parser()
Exemple #6
0
        def __init__(self,
                     color_scheme='NoColor',
                     completekey=None,
                     stdin=None,
                     stdout=None):

            # Parent constructor:
            if has_pydb and completekey is None:
                OldPdb.__init__(self, stdin=stdin, stdout=Term.cout)
            else:
                OldPdb.__init__(self, completekey, stdin, stdout)

            self.prompt = prompt  # The default prompt is '(Pdb)'

            # IPython changes...
            self.is_pydb = has_pydb

            if self.is_pydb:

                # iplib.py's ipalias seems to want pdb's checkline
                # which located in pydb.fn
                import pydb.fns
                self.checkline = lambda filename, lineno: \
                                 pydb.fns.checkline(self, filename, lineno)

                self.curframe = None
                self.do_restart = self.new_do_restart

                self.old_all_completions = __IPYTHON__.Completer.all_completions
                __IPYTHON__.Completer.all_completions = self.all_completions

                self.do_list = decorate_fn_with_doc(self.list_command_pydb,
                                                    OldPdb.do_list)
                self.do_l = self.do_list
                self.do_frame = decorate_fn_with_doc(self.new_do_frame,
                                                     OldPdb.do_frame)

            self.aliases = {}

            # Create color table: we copy the default one from the traceback
            # module and add a few attributes needed for debugging
            self.color_scheme_table = exception_colors()

            # shorthands
            C = ColorANSI.TermColors
            cst = self.color_scheme_table

            cst['NoColor'].colors.breakpoint_enabled = C.NoColor
            cst['NoColor'].colors.breakpoint_disabled = C.NoColor

            cst['Linux'].colors.breakpoint_enabled = C.LightRed
            cst['Linux'].colors.breakpoint_disabled = C.Red

            cst['LightBG'].colors.breakpoint_enabled = C.LightRed
            cst['LightBG'].colors.breakpoint_disabled = C.Red

            self.set_colors(color_scheme)

            # Add a python parser so we can syntax highlight source while
            # debugging.
            self.parser = PyColorize.Parser()