Re: [Zope] Re: ZOPE Python edit debug cycle

2000-09-01 Thread Toby Dickenson

On Tue, 29 Aug 2000 16:52:02 -0700, "Loren Stafford"
[EMAIL PROTECTED] wrote:

There's also the Refresh product
(http://www.zope.org/Members/hathawsh/Refresh) which helps reload some
(most) products without restarting Zope.

Is this still needed? Are you still suffering from Zope taking a long
time restart?


Toby Dickenson
[EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: ZOPE Python edit debug cycle

2000-08-29 Thread Chui Tey


"Phlip" [EMAIL PROTECTED] wrote in message
news:8oefpc$ve8$[EMAIL PROTECTED]...
 Newsgroupies.

 I installed ZOPE on Win32, and noticed it came with a bunch of
 "Products"; each a kind of "soft driver" written in some language
 (typically Python) to drive the ZObject space  build Web pages.

 Then I tried to edit a py file and see the new output. I had to use
 this sequence to see my tiny change:

 make the change
 save the change
 Stop the ZOPE service
 Start the ZOPE service
 Refresh the ZOPE Web page
 Inspect the change.

 If I had a syntax error, ZOPE throws it away and I never get to read
 it.


Tips:
#1. Start with -D option
#2. Use the PythonWin to run your changes through a tab nanny. (Side note:
edit.com messes up the tabs in the python code badly, use notepad if you
really have to), before restarting.
#3. Run from command line instead of a service
#4. just before where you changed the python code, insert
  import pdb
  pdb.set_trace()
  Have a look through the python debugger docos if you're not familiar.
This way you can step through your code.
  Setting breakpoints? download the latest pdb.py/bdb.py from
sourceforge, otherwise setting breakpoints is hard.
#5. you might be able to reload modules if your changes are small.

 The inner question: How, in ZOPE land, do you ask it to refresh its
 concepts of all the Python files without stopping and restarting the
 service?

 The outer question: What does a healthy edit/debug cycle look
 like?


#1. Get as much of your code working without Zope first.
#2. Fix as much code as you can before restarting. With Zope, really you
lose a lot of the interactivity in debugging code the python way.

 --
  Phlip
 === http://users.deltanet.com/~tegan/home.html ===


 Sent via Deja.com http://www.deja.com/
 Before you buy.

I've copied this in to the Zope.org mailing list. See you there!





___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Re: ZOPE Python edit debug cycle

2000-08-29 Thread Loren Stafford

From: "Karl Anderson" [EMAIL PROTECTED]

 "Chui Tey" [EMAIL PROTECTED] writes:

 [quoting someone]

   Then I tried to edit a py file and see the new output. I had to use
   this sequence to see my tiny change:
  
   make the change
   save the change
   Stop the ZOPE service
   Start the ZOPE service
   Refresh the ZOPE Web page
   Inspect the change.
  
   If I had a syntax error, ZOPE throws it away and I never get to read
   it.

 You can see the error if you try to access the broken product
 definition in the control panel.

 I keep a link to the product and the restart button handy to reduce
 the pain.


There's also the Refresh product
(http://www.zope.org/Members/hathawsh/Refresh) which helps reload some
(most) products without restarting Zope.

-- Loren



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )