Warning

This document hasn't been checked for compatibility with current versions of Plone. Use at your own risk.

Debug Products With Boa Constructor

by Joel Burton last modified Dec 06, 2009 09:27 PM
Contributors: Joel Burton
Boa Constructor is a free IDE for developing Python applications. This document shows how you can hook Boa Constructor up to Plone for debugging.

Introduction

This document describes how to debug products in the integrated developement environment boa-constructor.

Boa Constructor is a free (GPL), powerful, integrated developement environment (IDE) for Python. It has good Zope support.

While debugging Python Scripts is easy to manage the handling of products needs a additional product: BoaDebugger from BlueDynamics (thanks to Phil, Robert and Gogo).

All following text describes it on a Debian GNU/Linux. But there should not be many differences on other platforms.

Requirements

You have to use a zope-instance running on the same machine as boa-constructor. Zope should run in user-space as the same user as boa-constructor. Boa version should be recent.

Installation

I work with a Zope-Binary-Distribution from zope.org in user-space and boa-constructor from Debian-Unstable. Also you can get Boa from Sourceforge.

After setting up Zope download BoaDebugger from Bluedynamics CVS: simply choosing "Download tarball". Go to the products directory, unpack it and restart Zope.

Go to the Zope Management Interface (ZMI) and add the product BoaDebugger to your Root. You dont install the product with it, you only start a debugging-service. There is no entry in the ZODB after it. Ok, start the debugger with the defaults. If you need to add security use a username and password. After every restart of Zope you need to start the debugger.

Usage

After every restart of Zope you need to start the debugger as described in part installation.

In boa constructor open a python file from your products directory you want to debug. In the menu 'File' choose 'Attach to Debugger' and attach it with the defaults (username and password only if not left empty in ZMI). A new window appaers. It's the debugging window.

Go to ZMI and add 'BoaBreakpoint' to your Root. It seems that nothing happend, but in boa-constructor a new file is openend. Do not close it!

Now go back to your file you opened to debug. Set a breakpoint. Go to your browser and do something in order that the code with your breakpoint will be reached. In the Browser you detect that nothing happens. In boa constructor you'll now be able to do all the nice debugging stuff on your product.

Further Reading

See Ken Manheimer's comprehensive How To Conversing with Zope: Interactive Debugging With the Python Prompt.

Filed under: ,

Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.