Zope Debugger is an enhanced version of pdb for use with Zope. It can be used simply by inserting the following lines in any python code you'd like to debug, including Script (Python)'s and FSPythonScripts: from Products.zdb import set_trace set_trace() It requires no changes to Zope, CMF or Plone or any funky interaction with any specific kind of editing software. All you really need to do is insert the snippet above and make sure your Zope instance is running in foreground mode. For more information, please see: http://www.simplistix.co.uk/software/zope/zdb cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
En/na Chris Withers ha escrit:
For more information, please see: http://www.simplistix.co.uk/software/zope/zdb
2005-09-29 08:43:11 ERROR Zope Couldn't install zdb Traceback (most recent call last): File "/usr/local/zope-2.8.1-final/lib/python/OFS/Application.py", line 773, in install_product initmethod(context) File "/home/luca/zopetest/Products/zdb/__init__.py", line 64, in initialize pack._m['debug_compile'] = debug_compile TypeError: object does not support item assignment Traceback (most recent call last): File "/usr/local/zope-2.8.1-final/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/usr/local/zope-2.8.1-final/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/usr/local/zope-2.8.1-final/lib/python/Zope2/Startup/__init__.py", line 98, in prepare self.startZope() File "/usr/local/zope-2.8.1-final/lib/python/Zope2/Startup/__init__.py", line 257, in startZope Zope2.startup() File "/usr/local/zope-2.8.1-final/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/usr/local/zope-2.8.1-final/lib/python/Zope2/App/startup.py", line 95, in startup OFS.Application.initialize(application) File "/usr/local/zope-2.8.1-final/lib/python/OFS/Application.py", line 298, in initialize initializer.initialize() File "/usr/local/zope-2.8.1-final/lib/python/OFS/Application.py", line 327, in initialize self.install_products() File "/usr/local/zope-2.8.1-final/lib/python/OFS/Application.py", line 595, in install_products return install_products(app) File "/usr/local/zope-2.8.1-final/lib/python/OFS/Application.py", line 626, in install_products folder_permissions, raise_exc=debug_mode) File "/usr/local/zope-2.8.1-final/lib/python/OFS/Application.py", line 773, in install_product initmethod(context) File "/home/luca/zopetest/Products/zdb/__init__.py", line 64, in initialize pack._m['debug_compile'] = debug_compile TypeError: object does not support item assignment Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007
Luca Olivetti wrote:
folder_permissions, raise_exc=debug_mode) File "/usr/local/zope-2.8.1-final/lib/python/OFS/Application.py", line 773, in install_product initmethod(context) File "/home/luca/zopetest/Products/zdb/__init__.py", line 64, in initialize pack._m['debug_compile'] = debug_compile TypeError: object does not support item assignment
*sigh*, looks like some of the project registration machinery has changed between 2.7 and 2.8. I've opened a collector entry for this: https://secure.simplistix.co.uk/support/issue176 ...and I'll go and see if anyone on zope-dev@zope.org knows how to do this in 2.8 and 2.7... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On 9/29/05, Chris Withers <chris@simplistix.co.uk> wrote:
*sigh*, looks like some of the project registration machinery has changed between 2.7 and 2.8.
Well, you are using __dict__, which you aren't supposed t odo for new style classes, which FactoryDispatchers now seem to be. This code: if not hasattr(pack, '_m'): pack._m=fd.__dict__ fd.debug_compile = debug_compile fd.debug_compile__roles__ = ('Manager',) Goes around that, by setting the attributes on the original object instead of trying to manipulate the dicts directly. But I don't understand what you are trying to do, so I don't know if it's a good idea. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
On 9/29/05, Lennart Regebro <regebro@gmail.com> wrote:
This code:
if not hasattr(pack, '_m'): pack._m=fd.__dict__ fd.debug_compile = debug_compile fd.debug_compile__roles__ = ('Manager',)
Seems to work. I just needed to debug a script, and it worked fine! Great product!
For those people who are "porting" code to Zope 2.8, perhaps you want to read this: http://www.peterbe.com/plog/itp-on-zope-2.8.0 2005/9/29, Lennart Regebro <regebro@gmail.com>:
On 9/29/05, Lennart Regebro <regebro@gmail.com> wrote:
This code:
if not hasattr(pack, '_m'): pack._m=fd.__dict__ fd.debug_compile = debug_compile fd.debug_compile__roles__ = ('Manager',)
Seems to work. I just needed to debug a script, and it worked fine! Great product! _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
Lennart Regebro wrote:
if not hasattr(pack, '_m'): pack._m=fd.__dict__ fd.debug_compile = debug_compile fd.debug_compile__roles__ = ('Manager',)
Ah, but did you need to use zdb's recompile method?
Seems to work. I just needed to debug a script, and it worked fine! Great product!
Thanks :-) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (4)
-
Chris Withers -
Lennart Regebro -
Luca Olivetti -
Peter Bengtsson