Re: [Zope] Debugging a python routine

2005-06-28 Thread Garito

Dieter Maurer escribió:


John Poltorak wrote at 2005-6-27 16:45 +0100:
 

Can anyone suggest how I would go about debugging a Python routine like 
this through Zope?
   



It depends what type of object you want to debug, how much
money you are ready to invest and how much comfort you need.

At one endpoint is pdb (the Python debugger):

  * part of Python's runtime libary (no costs)

  * archaic user interface, (almost) without any comfort

  * after code changes able to debug trusted code
(and untrusted Python Scripts once you used
the appropriate allow_module and allow_class)
if Zope runs in the foreground.

The code change is adding a

 import pdb; pdb.set_trace()


At another endpoint is e.g. the commercial (!) WingIDE:

  * costs money, needs installation

  * comfortable, menu driven user interface

  * debugging of trusted code and untrusted PythonScripts

  * no code changes necessary


 


Hi all!
Dieter: can you send us some info about debug PythonScripts with WingIDE?

All: WingIDE is free if you develop open source. Rencently I ask them 
for some licences but I can't demostrate I'm working on open source and 
they send me 2 180 days licences (I have windows and mac plataforms). If 
you can demostrate you are developing open source (they only ask for the 
project's url) they send you permanent licences


Cheers

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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 )


Re: [Zope] Debugging a python routine

2005-06-28 Thread Dieter Maurer
Garito wrote at 2005-6-28 13:22 +0200:
...
Dieter: can you send us some info about debug PythonScripts with WingIDE?

No, I cannot -- colleagues of mine use it (and are quite
satisfied); I am using the archaic pdb :-)

But, I am sure, you find information on the respective web site...


All: WingIDE is free if you develop open source.

Even better: download it and look at its documentation...

-- 
Dieter
___
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 )


[Zope] Debugging a python routine

2005-06-27 Thread John Poltorak

Can anyone suggest how I would go about debugging a Python routine like 
this through Zope?


 span
tal:define=opts 
python:here.lib.parse_file(file=here.members,sepr=',',clone=1)
   tal:block repeat=opt opts
  lia tal:content=python:opt[1]
   tal:attributes=href python:opt[0]/a/li
   /tal:block
 /span


-- 
John



___
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 )


Re: [Zope] Debugging a python routine

2005-06-27 Thread Jonathan


- Original Message - 
From: John Poltorak [EMAIL PROTECTED]

Can anyone suggest how I would go about debugging a Python routine like
this through Zope?


span
tal:define=opts
python:here.lib.parse_file(file=here.members,sepr=',',clone=1)
  tal:block repeat=opt opts
 lia tal:content=python:opt[1]
  tal:attributes=href python:opt[0]/a/li
  /tal:block
/span



I would start by testing the python routine on its own (ie. without any ZPT 
stuff) to make sure it is producing what you expect, then add in the ZPT 
stuff bit-by-bit.



Jonathan 



___
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 )


Re: [Zope] Debugging a python routine

2005-06-27 Thread Barry Drake
I use a Script Python that writes to a ZPT.  It first
reads the ZPT then appends new info; first with a time
stamp, container info, and the message.  This works
from other Script Python objects or ZPTs.  It's quick
and dirty; but, I've been able to use it for most of
my debugging.

There are other methods mentioned in any book on Zope
that are more powerful.  I'm sure you'll receive
responses with those suggestions as well.

Barry Drake
USDA

--- John Poltorak wrote:
 
 Can anyone suggest how I would go about debugging a
 Python routine like 
 this through Zope?
 
 
  span
 tal:define=opts 

python:here.lib.parse_file(file=here.members,sepr=',',clone=1)
tal:block repeat=opt opts
   lia tal:content=python:opt[1]
tal:attributes=href
 python:opt[0]/a/li
/tal:block
  /span
 
 
 -- 
 John
 
 
 
 ___
 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 )
 
___
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 )


Re: [Zope] Debugging a python routine

2005-06-27 Thread Barry Drake
More info that may be of help:

* Ken Manheimer's wiki on Zope debugging at
zope.org:
http://zope.org/Members/klm/ZopeDebugging/FrontPage
* Ken's original paper on the matter:
http://zope.org/Members/klm/ZopeDebugging/ConversingWithZope
* A more advanced coverage of the matter at
zopewiki.org:
http://zopewiki.org/DebuggingZopeWithPythonDebugger2

I got these from here:

http://docs.neuroinf.de/programming-plone/debug

Cheers!
Barry Drake

--- John Poltorak wrote:
 
 Can anyone suggest how I would go about debugging a
 Python routine like 
 this through Zope?
 
 
  span
 tal:define=opts 

python:here.lib.parse_file(file=here.members,sepr=',',clone=1)
tal:block repeat=opt opts
   lia tal:content=python:opt[1]
tal:attributes=href
 python:opt[0]/a/li
/tal:block
  /span
 
 
 -- 
 John
 
 
 
 ___
 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 )
 
___
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 )


RE: [Zope] Debugging a python routine

2005-06-27 Thread Pascal Peregrina
Well, I guess that you want to debug here.lib.parse_file() as the rest is
quiet obvious...

If parse_file is a PythonScript, you can test it from the ZMI, and you
should get a stack trace if an exception is raised.

Pascal

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de
Jonathan
Envoyé : lundi 27 juin 2005 17:57
À : John Poltorak; zope@zope.org
Objet : Re: [Zope] Debugging a python routine



- Original Message - 
From: John Poltorak [EMAIL PROTECTED]
 Can anyone suggest how I would go about debugging a Python routine like
 this through Zope?


 span
 tal:define=opts
 python:here.lib.parse_file(file=here.members,sepr=',',clone=1)
   tal:block repeat=opt opts
  lia tal:content=python:opt[1]
   tal:attributes=href python:opt[0]/a/li
   /tal:block
 /span


I would start by testing the python routine on its own (ie. without any ZPT 
stuff) to make sure it is producing what you expect, then add in the ZPT stuff 
bit-by-bit.


Jonathan 


___
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 )


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**

___
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 )