[Checkins] SVN: grokcore.startup/trunk/ Revert the removal of the zdaemon controller code to retain backwards compatibility with the ctl scripts generated by the current version of grokproject.

Jan-Jaap Driessen jdriessen at thehealthagency.com
Wed Apr 14 09:42:42 EDT 2010


Log message for revision 110884:
  Revert the removal of the zdaemon controller code to retain backwards compatibility with the ctl scripts generated by the current version of grokproject.
  
  

Changed:
  U   grokcore.startup/trunk/CHANGES.txt
  U   grokcore.startup/trunk/src/grokcore/startup/__init__.py
  U   grokcore.startup/trunk/src/grokcore/startup/startup.py

-=-
Modified: grokcore.startup/trunk/CHANGES.txt
===================================================================
--- grokcore.startup/trunk/CHANGES.txt	2010-04-14 13:38:40 UTC (rev 110883)
+++ grokcore.startup/trunk/CHANGES.txt	2010-04-14 13:42:42 UTC (rev 110884)
@@ -4,8 +4,6 @@
 0.5 (unreleased)
 ================
 
-- Remove the zdaemon controller.
-
 - The upgrade notes will be moved to the Grok upgrade notes.
 
 - Define entry points for main and debug application factories in

Modified: grokcore.startup/trunk/src/grokcore/startup/__init__.py
===================================================================
--- grokcore.startup/trunk/src/grokcore/startup/__init__.py	2010-04-14 13:38:40 UTC (rev 110883)
+++ grokcore.startup/trunk/src/grokcore/startup/__init__.py	2010-04-14 13:42:42 UTC (rev 110884)
@@ -14,5 +14,5 @@
 # Make this a package.
 from grokcore.startup.startup import (application_factory,
                                       debug_application_factory,
-                                      interactive_debug_prompt)
-
+                                      interactive_debug_prompt,
+                                      zdaemon_controller)

Modified: grokcore.startup/trunk/src/grokcore/startup/startup.py
===================================================================
--- grokcore.startup/trunk/src/grokcore/startup/startup.py	2010-04-14 13:38:40 UTC (rev 110883)
+++ grokcore.startup/trunk/src/grokcore/startup/startup.py	2010-04-14 13:42:42 UTC (rev 110884)
@@ -1,9 +1,11 @@
 import os.path
+import sys
 import code
 import zope.app.wsgi
 import zope.app.debug
 
 from zope.component import provideAdapter
+from zope.security.interfaces import IUnauthorized
 from zope.publisher.interfaces import IReRaiseException
 from zope.dottedname.resolve import resolve
 
@@ -45,3 +47,24 @@
                                         'app':      debugger,
                                         'root':     debugger.root()})
 
+
+# To retain backwards compatibilty with the ctl scripts generated by previous
+# versions of grokproject we keep the zdaemon controller code.
+# The intention is to have this code removed during the Grok 1.2 release.
+
+import zdaemon.zdctl
+
+class ControllerCommands(zdaemon.zdctl.ZDCmd):
+
+    def do_debug(self, rest):
+        interactive_debug_prompt()
+
+    def help_debug(self):
+        print "debug -- Initialize the application, providing a debugger"
+        print "         object at an interactive Python prompt."
+
+def zdaemon_controller(zdaemon_conf=os.path.join('parts', 'etc',
+                                                 'zdaemon.conf')):
+    args = ['-C', zdaemon_conf] + sys.argv[1:]
+    zdaemon.zdctl.main(args, options=None, cmdclass=ControllerCommands)
+



More information about the checkins mailing list