Skip to main content

Display source code in your editor while debugging with pdb.

Project description

This module is used to hook up pdb, the python debugger, with your editor. This enables it to display the debugged source code during a pdb session.

You can install with pip:

$ pip install PdbEditorSupport

Or download, unpack the package and install with:

$ python setup.py install

Next you need to hook up pdb with this module. See the next sections to see how.

Afterwards your editor should get started automatically whenever you enter a debug session. The current source line will be displayed simultaneously while stepping through the code.

Editors

Sublime Text

For Sublime Text support add this to .pdbrc:

import PdbEditorSupport
PdbEditorSupport.patch(editor='sublime')

Ensure that the subl command line tool has been installed as per these instructions.

The subl command will by default called with -b filename:lineno, where filename and lineno are replaced accordingly.

You can change the default subl command by setting the command keyword option.

You can change the default arguments with the command_args keyword option.

Example with the defaults:

import PdbEditorSupport
PdbEditorSupport.patch(
    editor='sublime',
    command='subl',
    command_args=['-b', '{filename}:{lineno}'])

TextMate

For Sublime Text support add this to .pdbrc:

import PdbEditorSupport
PdbEditorSupport.patch(editor='textmate')

You can change the default TextMate application name with the application keyword option.

You can change the default url used via Apple Script with the url keyword option.

Example with the defaults:

import PdbEditorSupport
PdbEditorSupport.patch(
    editor='textmate',
    application='TextMate',
    url='txmt://open?url=file://{filename}&line={lineno}&column=2')

Other editors

Other editors which allow opening files via the command line can be used as well.

You can use arbitrary shell commands like this:

import PdbEditorSupport
PdbEditorSupport.patch(
    func='shell',
    command='mycommand',
    command_args=['{filename}:{lineno}'])

Acknowledgments

This module is based on PdbSublimeTextSupport by Martin Aspeli, which in turn is based on PdbTextMateSupport by Andi Zeidler and others.

Changes

0.3.0 (2018-07-28)

  • Initial release after fork from PdbSublimeTextSupport and PdbTextMateSupport. [fschulze]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PdbEditorSupport-0.3.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

PdbEditorSupport-0.3.0-py2-none-any.whl (3.4 kB view details)

Uploaded Python 2

File details

Details for the file PdbEditorSupport-0.3.0.tar.gz.

File metadata

  • Download URL: PdbEditorSupport-0.3.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: devpi-server/4.6.0 (py2.7.15; darwin)

File hashes

Hashes for PdbEditorSupport-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9d7bbab0711c05a9f6b5e419e87a220fad492aeb23a1fd7f0d3259a921e90943
MD5 f1126195ac078e22a86c65baa9c5712e
BLAKE2b-256 57fb2b24f450a71ac373892b2bad98aca1d8f6c2933aac067910c565f15be318

See more details on using hashes here.

File details

Details for the file PdbEditorSupport-0.3.0-py2-none-any.whl.

File metadata

File hashes

Hashes for PdbEditorSupport-0.3.0-py2-none-any.whl
Algorithm Hash digest
SHA256 b6c2297e8899ee83f015ede7e3ddbcbded9c9e7fbf2caeb6c39c5ae18fa495e4
MD5 1ffbce99b4ccbc3e27a8e65ad0ef3ef8
BLAKE2b-256 7648f791ac76488579a41a5c0b7e97a66e5b5c3532b1134092fe3fb6042bc746

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page