[Checkins] SVN: Sandbox/philikon/zopeproject/trunk/ Added a
zopectl-lookalike script (which just starts paster). Renamed
the debug
Philipp von Weitershausen
philikon at philikon.de
Sat Sep 15 11:45:31 EDT 2007
Log message for revision 79676:
Added a zopectl-lookalike script (which just starts paster). Renamed the debug
script for consistent naming.
Changed:
U Sandbox/philikon/zopeproject/trunk/README.txt
U Sandbox/philikon/zopeproject/trunk/zopeproject/zope_app/setup.py_tmpl
U Sandbox/philikon/zopeproject/trunk/zopeproject/zope_app/src/+package+/startup.py
A Sandbox/philikon/zopeproject/trunk/zopeproject/zope_deploy/zdaemon.conf
-=-
Modified: Sandbox/philikon/zopeproject/trunk/README.txt
===================================================================
--- Sandbox/philikon/zopeproject/trunk/README.txt 2007-09-15 15:11:50 UTC (rev 79675)
+++ Sandbox/philikon/zopeproject/trunk/README.txt 2007-09-15 15:45:31 UTC (rev 79676)
@@ -179,7 +179,7 @@
``bin/``
This directory contains all executable scripts, e.g for starting the
application (``paster``), installing or reinstalling dependencies
- (``buildout``), or invoking the debug prompt (``debug-myzopeapp``).
+ (``buildout``), or invoking the debug prompt (``myzopeapp-debug``).
``src/``
This directory contains the Python package(s) of your application.
@@ -264,9 +264,9 @@
of the application, such as walking the object hierarchy in the ZODB
or looking up components manually. This can be done with the
interactive debug prompt, which is available under
-``bin/debug-myzopeapp``::
+``bin/myzopeapp-debug``::
- $ bin/debug-myzopeapp
+ $ bin/myzopeapp-debug
Welcome to the interactive debug prompt.
The 'root' variable contains the ZODB root folder.
The 'app' variable contains the Debugger, 'app.publish(path)' simulates a request.
@@ -316,8 +316,13 @@
* Make use of ``zope.app.wsgi.getApplication()`` to reduce the startup
boiler-plate in ``startup.py`` (formerly ``application.py``).
+* Added a zdaemon controller script much like zopectl called
+ ``*package*-ctl`` (where ``*package*`` is the name of the package
+ created with zopeproject).
+
* Added a debug script that configures the application and drops into
- an interpreter session.
+ an interpreter session. It is also available via ``*package*-ctl
+ debug``
* The package that zopeproject creates is now located in a ``src``
directory, where it's easier to single out among the other files and
Modified: Sandbox/philikon/zopeproject/trunk/zopeproject/zope_app/setup.py_tmpl
===================================================================
--- Sandbox/philikon/zopeproject/trunk/zopeproject/zope_app/setup.py_tmpl 2007-09-15 15:11:50 UTC (rev 79675)
+++ Sandbox/philikon/zopeproject/trunk/zopeproject/zope_app/setup.py_tmpl 2007-09-15 15:45:31 UTC (rev 79676)
@@ -25,6 +25,7 @@
install_requires=['setuptools',
'ZODB3',
'ZConfig',
+ 'zdaemon',
'zope.annotation',
'zope.copypastemove',
'zope.event',
@@ -44,7 +45,8 @@
],
entry_points = """
[console_scripts]
- debug-${package} = ${package}.startup:interactive_debug_prompt
+ ${package}-debug = ${package}.startup:interactive_debug_prompt
+ ${package}-ctl = ${package}.startup:zdaemon_controller
[paste.app_factory]
main = ${package}.startup:application_factory
"""
Modified: Sandbox/philikon/zopeproject/trunk/zopeproject/zope_app/src/+package+/startup.py
===================================================================
--- Sandbox/philikon/zopeproject/trunk/zopeproject/zope_app/src/+package+/startup.py 2007-09-15 15:11:50 UTC (rev 79675)
+++ Sandbox/philikon/zopeproject/trunk/zopeproject/zope_app/src/+package+/startup.py 2007-09-15 15:45:31 UTC (rev 79676)
@@ -1,5 +1,7 @@
import os
+import sys
import code
+import zdaemon.zdctl
import zope.app.wsgi
import zope.app.debug
@@ -18,3 +20,16 @@
code.interact(banner=banner, local={'debugger': debugger,
'app': debugger,
'root': debugger.root()})
+
+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='zdaemon.conf'):
+ args = ['-C', zdaemon_conf] + sys.argv[1:]
+ zdaemon.zdctl.main(args, options=None, cmdclass=ControllerCommands)
Added: Sandbox/philikon/zopeproject/trunk/zopeproject/zope_deploy/zdaemon.conf
===================================================================
--- Sandbox/philikon/zopeproject/trunk/zopeproject/zope_deploy/zdaemon.conf (rev 0)
+++ Sandbox/philikon/zopeproject/trunk/zopeproject/zope_deploy/zdaemon.conf 2007-09-15 15:45:31 UTC (rev 79676)
@@ -0,0 +1,8 @@
+<runner>
+ program bin/paster serve deploy.ini
+ daemon on
+ transcript log/zdaemon.log
+ socket-name var/zdaemonsock
+ # Enable this to run the child process as a different user
+ # user zope
+</runner>
More information about the Checkins
mailing list