ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

PDB Finder

by aleGpereira ST2

A sublime plug-in to help us find python pdb's in case we forget to clean before a commit.

Details

Installs

  • Total 157
  • Win 79
  • Mac 39
  • Linux 39
Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime PDB Finder

A Sublime Text 2 plugin to extract and list Python PDB lines from open files and project folders.

Install

The preferred method is to use the Sublime Package Manager. Once you have Package Control installed, just search for PDB Finder.

Alternatively, checkout from github:

$ cd Sublime Text 2/Packages

$ git clone https://github.com/aleGpereira/sublime-pdb-finder.git

Config

All plugin configuration must be placed in user or project-specific settings inside a pdbfinder object, for example;

{
    // other user config ...
    "pdbfinder": {
        "patterns": {}
    }
}

An example


"pdbfinder": {
    "file_exclude_patterns": [
        "*.css",
        "*.po",
        "*.mo",
        "*.pyc"
    ],
    "folder_exclude_patterns": [
        "static",
        "vendor",
        "tmp"
    ],
    "case_sensitive": true,
    "result_title": "PDB Results"
},

Adding patterns

Extraction uses regular expressions that return one match group representing the message. Since this plugin is set to search for Python pdb's, you can add patterns to provide PDB lines in some other language. To override or provide more patterns, add patterns to user settings, e.g.

"patterns": {
    'PDB': r'(?P<pdb>import[\s]*pdb[\s]*;[\s]*pdb\.set_trace\(\).*)$',
}

Note that the pattern must provide at least one named group which will be used to group the comments in results.

By default, searching is not case sensitive. You can change this behaviour by adding

"case_sensitive": true

to the pdbfinder settings object.

Excluding files and folders

Global settings folder_exclude_patterns, file_exclude_patterns and binary_file_patterns are excluded from search results.

To exclude further directories, add directory names (not glob pattern or regexp) to folder_exclude_patterns in Pdbfinder settings:

"pdbfinder": {
    "folder_exclude_patterns": [
        "vendor", 
        "tmp"
    ]
}

To add file excludes, add glob patterns to file_exclude_patterns:

"file_exclude_patterns": [
    "*.css"
]

Results title

Override the results view title by setting result_title

"result_title": "PDBs Results"

Usage

  • Find PDBs: Project and open files scans all files in your project.

  • Find PDBs: Open files only scans only open, saved files.

Both are triggered from the command palette. No default key bindings are provided.

If we have results, a list is going to be show with:

  • The file name.

  • The line in wich that pdb can be found.

  • The content of the next line, if we have one. If not, EOF is shown.

Navigating results


Results can be navigated by keyboard and mouse:

  • n ext, p revious, c lear, enter
  • alt-double click (shift-double click in Linux)

Note that due to the lack of support for context in mousemaps right now, alt-double click will trigger in any document, though it should be a no-op.

VERY IMPORTANT NOTE

Sublime PDB Finder has been inherited from SublimeTODO by his author Rob Cowie. I really liked that tool. So thanks to him too!!.

License

All of Sublime PDB Finder is licensed under the MIT license.

Copyright © 2013 Alejandro Pereira alepereira86@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.