Skip to main content

Tools to help debugging a zope based application

Project description

What is iw.debug

This package allow you to start the python debugger (pdb) or the ipython debugger (ipdb) on any objects in zope. For that you have to add /pdb to the url of any object. And if your zope instance is in debug mode it will start the (i)pdb in your terminal.

Exploring objects

Run your zope instance in foreground:

./bin/zopectl fg

Call an url ended with /pdb:

wget http://localhost:8080/portal/pdb

Then you get (i)pdb prompt in your console:

ipdb>

Typing ll will show you a few locals:

ipdb> ll
Out[0]:
{'context': <PloneSite at /portal>,
 'meth': None,
 'portal': <PloneSite at /portal>,
 'request': <HTTPRequest, URL=http://localhost:8080/portal/@@pdb/pdb>,
 'view': None}

Debuging objects views and methods

You can also use a query string in the url to debug a callable:

wget http://localhost:8080/portal/pdb?v=__repr__

Then back to your console:

ipdb> ll
Out[0]:
{'context': <PloneSite at /portal>,
 'meth': <bound method PloneSite.__repr__ of <PloneSite at /portal>>,
 'portal': <PloneSite at /portal>,
 'request': <HTTPRequest, URL=http://localhost:8080/portal/@@pdb/pdb>,
 'view': None}

If a browser view is found, then it will be used as callable:

wget http://localhost:8080/portal/pdb?v=rules-controlpanel

Then back to your console:

ipdb> ll
ipdb> Out[0]:
{'context': <PloneSite at /portal>,
 'meth': None,
 'portal': <PloneSite at /portal>,
 'request': <HTTPRequest, URL=http://localhost:8080/portal/@@pdb/pdb>,
 'view': <Products.Five.metaclass.ContentRulesControlPanel object at ...>}

For both view and callable, you can enter in it by typing s:

ipdb> s
ipdb> --Call--
> /../plone/app/contentrules/browser/controlpanel.py(18)__call__()
     17
---> 18     def __call__(self):
     19         form = self.request.form

If you want to pass extra args to the callable do something like:

wget http://localhost:8080/portal/pdb?v=myview&arg1=value1&arg2:int=2

Extra args will be passed to the callable as keyword arguments.

Add iw.debug to your plone3 buildout

In the [buildout] section of your buildout.cfg add:

[buildout]
...
# Add additional eggs here
# elementtree is required by Plone
eggs =
  elementtree
  iw.debug
  ...

Then in the [instance] section:

[instance]
...
# If you want to register ZCML slugs for any packages, list them here.
# e.g. zcml = my.package my.other.package
zcml = iw.debug
       ...

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

iw.debug-0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iw.debug-0.2-py2.4.egg (9.3 kB view details)

Uploaded Egg

File details

Details for the file iw.debug-0.2.tar.gz.

File metadata

  • Download URL: iw.debug-0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for iw.debug-0.2.tar.gz
Algorithm Hash digest
SHA256 ca9b9f4e1fa8eea96f549da5cde3cd0ceae6fb03748d0af0f44224a4ab202ce3
MD5 318b79e44b5a72f60a06c9e39e97193d
BLAKE2b-256 1078c0fcb1edc03e0a1713a9e66a9225fbb2fff1c73c520ff9e2f9a9a1123459

See more details on using hashes here.

File details

Details for the file iw.debug-0.2-py2.4.egg.

File metadata

  • Download URL: iw.debug-0.2-py2.4.egg
  • Upload date:
  • Size: 9.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for iw.debug-0.2-py2.4.egg
Algorithm Hash digest
SHA256 2fe4fc7fc6f2fcb81a1e45cac49ec654891257333ad4d265df1345ec86704ecb
MD5 31448a62bb791c1d49746463ed48e215
BLAKE2b-256 b6b833f10712521d938fd7e2edc26998bc55af31d428790287a070ebef097bce

See more details on using hashes here.

Supported by

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