Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install stxnext.pdb

How to install stxnext.pdb

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install stxnext.pdb
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2.1 Available View build log
Windows (64-bit)
0.2.1 Available View build log
Mac OS X (10.5+)
0.2.1 Available View build log
Linux (32-bit)
0.2.1 Available View build log
Linux (64-bit)
0.2.1 Available View build log
 
License
Zope Public License, Version 2.1 (ZPL)
Dependencies
Imports
Lastest release
version 0.2.1 on Jan 5th, 2011

Overview

This is standard Python Debugger extended with few features that makes debugging easier.

stxnext.pdb offer convenience mainly for zope users, but can be used for other python projects too.

Features

New features added to standard pdb:

  • improved dir function. Standard dir function lists names of all

System Message: WARNING/2 (<string>, line 21)

Bullet list ends without a blank line; unexpected unindent.

methods and attributs of some object. This improved dir prints output from this function in few columns. Also possible is filtering using regular expressions.

Examples:

(STX Next pdb) obj = object()
(STX Next pdb) dir(obj)

System Message: ERROR/3 (<string>, line 29)

Inconsistent literal block quoting.

__class__ __reduce__ __delattr__ __reduce_ex__ __doc__ __repr__ __getattribute__ __setattr__ __hash__ __str__ __init__ __new__ (STX Next pdb) dir obj attr __delattr__ __setattr__ __getattribute__ (STX Next pdb) dir obj ^__[r-z]+ __reduce__ __setattr__ __reduce_ex__ __str__ __repr__

  • info command prints basic information about object.

Examples:

(STX Next pdb) info obj

System Message: ERROR/3 (<string>, line 49)

Inconsistent literal block quoting.

type: <type 'object'> class: <type 'object'> id: 140460386956752 str: <object object at 0x7fbf7b7835d0> repr: <object object at 0x7fbf7b7835d0> docstring: The most base type

  • update_locals (ul) - update current locals by few useful variables

System Message: WARNING/2 (<string>, line 57)

Bullet list ends without a blank line; unexpected unindent.

and functions. If stxnext.pdb can find zope or plone it imports frequently used functions (e.g. getToolByName, getMultiAdapter, alsoProvides). If context is available it can also import plone tools. stxnext.pdb looks for variables named self.context, context and self in current locals. If context should be other it can be passwd as parameter:

Examples:

(STX Next pdb) update_locals #zope found, context unknown

System Message: ERROR/3 (<string>, line 66)

Inconsistent literal block quoting.

New locals: Attribute Interface ... schema sys

(STX Next pdb) ul this_is_context #zope and plone found, correct context New locals: Attribute Interface ... sys uid_catalog

Using

stxnext.pdb can be opened by standard pdb invoke - only pdb must be imported from stxnext module.

Because collective SVN repository blocks commits with set_trace in code, in next line you must replace '*' with '_':

>>> import pdb; pdb.set*trace() #open standard pdb

System Message: ERROR/3 (<string>, line 92)

Inconsistent literal block quoting.

(Pdb) c >>> from stxnext import pdb; pdb.set*trace() (STX Next pdb) c

If zope instance runned with debug-mode=on, pdb can be invoked from web browser - just add pdb to url (e.g. http://127.0.0.1:8080/plonesite/pdb). In this approach stxnext.pdb tries to turn on tab completion - see rlcompleter documentation.

Installation

Alternatively, if you are using zc.buildout to manage your project, you can do this:

  • Add stxnext.pdb to the list of eggs to install, e.g.:

    System Message: WARNING/2 (<string>, line 110)

    Literal block expected; none found.

[buildout] ... eggs = ... stxnext.pdb

  • If you're using plone.recipe.zope2instance recipe to manage your

System Message: WARNING/2 (<string>, line 117)

Bullet list ends without a blank line; unexpected unindent.

instance add this lines to install a ZCML slug:

[instance]

System Message: ERROR/3 (<string>, line 120)

Inconsistent literal block quoting.

recipe = plone.recipe.zope2instance ... zcml = ... stxnext.pdb

  • If you're using zc.zope3recipes:application recipe to manage your

System Message: WARNING/2 (<string>, line 127)

Bullet list ends without a blank line; unexpected unindent.

instance add this lines to install a ZCML slug:

[instance]

System Message: ERROR/3 (<string>, line 130)

Inconsistent literal block quoting.

recipe = zc.zope3recipes:application ... site.zcml = ... <include package="stxnext.pdb" />

  • Re-run buildout, e.g. with:

    System Message: WARNING/2 (<string>, line 138)

    Literal block expected; none found.

$ ./bin/buildout

You can skip the ZCML slug if you are going to explicitly include the package from another package's configure.zcml file.

Author & Contact

Author:Wojciech Lichota <wojciech.lichota[at]stxnext.pl>
http://stxnext.pl/open-source/files/stx-next-logo

STX Next Sp. z o.o.

http://stxnext.pl

info@stxnext.pl

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.