Zope in DevelopmentMode

26 June 2005   0 comments   Zope

Mind That Age!

This blog post is 12 years old! Most likely, its content is outdated. Especially if it's technical.

Powered by Fusion×

Imagine if you, in your code, want to find out if Zope is running in debug mode or not, then how do you do that? Here's my take on it that I learned today:

from Globals import DevelopmentMode

class MyProduct(Folder):
   def save(self, file):
       if DevelopmentMode:
           print "Saving the file now"
       self._save(file)

The example doesn't do much justice because your product code should perhaps use its own "debug mode parameter" to get greater control.

I needed this because instead of using the Auto refresh feature inside the ZMI I have a script that periodically checks for changes and does a manual refresh. When you're not in debug mode, a change to a .dtml or .zpt requires a refresh whereas when you're in debug mode it doesn't need refreshing to see the changes.

I'll try to find some later later this month to write about and share my refresh script which is something that I now can't live work without when doing Zope development.

Follow @peterbe on Twitter

Comments

Thank you for posting a comment

Your email will never ever be published


Related posts

Previous:
AJAX accelerated web widgets 23 June 2005
Next:
ztar - my wrapper on tar -z 29 June 2005
Related by Keyword:
Local Django development with Nginx 11 October 2010
IssueTrackerProduct 0.7 released 16 December 2005
Python package path when executed elsewhere 14 December 2004
Pretty print SQL script 06 August 2004
Related by Text:
Toggle Zope's debug mode 01 October 2005
ReCSS a tool to reload the CSS without reloading the whole page 31 January 2006
Geeking with Eterm and Tkinter 09 February 2006
Goodies from tornado-utils - part 2: tornado_static 22 September 2011
Automatically refreshing issue 17 November 2005