How to use the pudb.settings.save_breakpoints function in pudb

To help you get started, we’ve selected a few pudb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inducer / pudb / test / test_settings.py View on Github external
def test_save_breakpoints(mocker):
    MockBP = collections.namedtuple('MockBreakpoint', 'file line cond')
    mock_breakpoints = [MockBP('/home/user/test.py', 41, None),
                        MockBP('/home/user/test.py', 50, None)]
    mocker.patch('pudb.settings.get_breakpoints_file_name',
                 mocker.Mock(return_value='saved-breakpoints'))
    mock_open = mocker.mock_open()
    mocker.patch.object(builtins, 'open', mock_open)

    save_breakpoints(mock_breakpoints)
    mock_open.assert_called_with('saved-breakpoints', 'w')
github SkyLeach / pudb.vim / rplugin / python3 / vim_pudb.py View on Github external
bps = []
        if buffname in self._bps_placed:
            for ln in self._bps_placed[buffname]:
                bps.append(self.pudbbp(buffname, int(ln / 10)))
        for bpt in self.iter_breakpoints():
            if bpt.filename == buffname:
                # we already placed these
                continue
            else:
                # make sure we pass on anything we aren't messing with
                bps.append(bpt)
        __logger__.debug(
            'Updating breakpoints in pudb:\n    %s',
            pprint.pformat(
                list(map(lambda x: Breakpoint(x.filename, x.lineno), bps))))
        pudb.settings.save_breakpoints(
            list(map(lambda x: Breakpoint(x.filename, x.lineno), bps)))
github inducer / pudb / pudb / debugger.py View on Github external
def save_breakpoints(self):
        from pudb.settings import save_breakpoints
        save_breakpoints([
            bp
            for fn, bp_lst in self.get_all_breaks().items()
            for lineno in bp_lst
            for bp in self.get_breaks(fn, lineno)
            if not bp.temporary])
github inducer / pudb / pudb / debugger.py View on Github external
def save_breakpoints(self):
        from pudb.settings import save_breakpoints
        save_breakpoints([
            bp
            for fn, bp_lst in self.get_all_breaks().iteritems()
            for lineno in bp_lst
            for bp in self.get_breaks(fn, lineno)
            if not bp.temporary])