[z3-checkins] r47137 - in z3/NudgeNudge/trunk: . log src/nudgenudge
philikon at codespeak.net
philikon at codespeak.net
Wed Oct 3 23:01:32 CEST 2007
Author: philikon
Date: Wed Oct 3 23:01:31 2007
New Revision: 47137
Added:
z3/NudgeNudge/trunk/log/ (props changed)
z3/NudgeNudge/trunk/simple.ini
z3/NudgeNudge/trunk/src/nudgenudge/startup.py (contents, props changed)
z3/NudgeNudge/trunk/zdaemon.conf
z3/NudgeNudge/trunk/zope.conf
Modified:
z3/NudgeNudge/trunk/buildout.cfg
z3/NudgeNudge/trunk/deploy.ini
z3/NudgeNudge/trunk/setup.py
Log:
More like zopeproject-based sandbox
Modified: z3/NudgeNudge/trunk/buildout.cfg
==============================================================================
--- z3/NudgeNudge/trunk/buildout.cfg (original)
+++ z3/NudgeNudge/trunk/buildout.cfg Wed Oct 3 23:01:31 2007
@@ -10,7 +10,6 @@
[app]
recipe = zc.recipe.egg
eggs = NudgeNudge
- zope.paste
Paste
PasteDeploy
PasteScript
Modified: z3/NudgeNudge/trunk/deploy.ini
==============================================================================
--- z3/NudgeNudge/trunk/deploy.ini (original)
+++ z3/NudgeNudge/trunk/deploy.ini Wed Oct 3 23:01:31 2007
@@ -10,9 +10,7 @@
next = zope
[app:zope]
-use = egg:zope.paste
-site_definition = site.zcml
-file_storage = var/Data.fs
+use = egg:NudgeNudge
[server:main]
use = egg:Paste#http
Modified: z3/NudgeNudge/trunk/setup.py
==============================================================================
--- z3/NudgeNudge/trunk/setup.py (original)
+++ z3/NudgeNudge/trunk/setup.py Wed Oct 3 23:01:31 2007
@@ -28,4 +28,11 @@
'zope.app.securitypolicy',
'zope.app.zcmlfiles',
],
+ entry_points = """
+ [console_scripts]
+ nudgenudge-debug = nudgenudge.startup:interactive_debug_prompt
+ nudgenudge-ctl = nudgenudge.startup:zdaemon_controller
+ [paste.app_factory]
+ main = nudgenudge.startup:application_factory
+ """
)
Added: z3/NudgeNudge/trunk/simple.ini
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/trunk/simple.ini Wed Oct 3 23:01:31 2007
@@ -0,0 +1,7 @@
+[app:main]
+use = egg:NudgeNudge
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
Added: z3/NudgeNudge/trunk/src/nudgenudge/startup.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/trunk/src/nudgenudge/startup.py Wed Oct 3 23:01:31 2007
@@ -0,0 +1,35 @@
+import os
+import sys
+import code
+import zdaemon.zdctl
+import zope.app.wsgi
+import zope.app.debug
+
+def application_factory(global_conf, conf='zope.conf'):
+ zope_conf = os.path.join(global_conf['here'], conf)
+ return zope.app.wsgi.getWSGIApplication(zope_conf)
+
+def interactive_debug_prompt(zope_conf='zope.conf'):
+ db = zope.app.wsgi.config(zope_conf)
+ debugger = zope.app.debug.Debugger.fromDatabase(db)
+ # Invoke an interactive interpreter shell
+ banner = ("Welcome to the interactive debug prompt.\n"
+ "The 'root' variable contains the ZODB root folder.\n"
+ "The 'app' variable contains the Debugger, 'app.publish(path)' "
+ "simulates a request.")
+ 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: z3/NudgeNudge/trunk/zdaemon.conf
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/trunk/zdaemon.conf Wed Oct 3 23:01:31 2007
@@ -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>
Added: z3/NudgeNudge/trunk/zope.conf
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/trunk/zope.conf Wed Oct 3 23:01:31 2007
@@ -0,0 +1,38 @@
+# Identify the component configuration used to define the site:
+site-definition site.zcml
+
+<zodb>
+ # Standard Filestorage
+ <filestorage>
+ path var/Data.fs
+ </filestorage>
+
+# Uncomment this if you want to connect to a ZEO server instead:
+# <zeoclient>
+# server localhost:8100
+# storage 1
+# # ZEO client cache, in bytes
+# cache-size 20MB
+# # Uncomment to have a persistent disk cache
+# #client zeo1
+# </zeoclient>
+</zodb>
+
+<eventlog>
+ # This sets up logging to both a file and to standard output
+ # (STDOUT). The "path" setting can be a relative or absolute
+ # filesystem path or the tokens STDOUT or STDERR.
+
+ <logfile>
+ path log/z3.log
+ formatter zope.exceptions.log.Formatter
+ </logfile>
+
+ <logfile>
+ path STDOUT
+ formatter zope.exceptions.log.Formatter
+ </logfile>
+</eventlog>
+
+# Uncomment this to switch on developer mode (e.g. for APIDoc)
+#devmode on
More information about the z3-checkins
mailing list