[Checkins] SVN: grok/trunk/doc/ Lots of updates. Make all the tutorials have a self-contained buildout

Martijn Faassen faassen at startifact.com
Mon Aug 31 13:26:31 EDT 2009


Log message for revision 103416:
  Lots of updates. Make all the tutorials have a self-contained buildout
  (based on the one in 'template'). Update tutorial.rst to use the term
  Zope Toolkit more and just restart the 'server', not 'Zope'.
  

Changed:
  _U  grok/trunk/doc/groktut/
  D   grok/trunk/doc/groktut/INSTALL.txt
  A   grok/trunk/doc/groktut/a_second_model/bootstrap.py
  U   grok/trunk/doc/groktut/a_second_model/buildout.cfg
  A   grok/trunk/doc/groktut/a_second_model/etc/
  A   grok/trunk/doc/groktut/a_second_model/etc/README.txt
  A   grok/trunk/doc/groktut/a_second_model/etc/debug.ini.in
  A   grok/trunk/doc/groktut/a_second_model/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/a_second_model/etc/site.zcml.in
  A   grok/trunk/doc/groktut/a_second_model/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/a_second_model/etc/zope.conf.in
  U   grok/trunk/doc/groktut/a_second_model/setup.py
  U   grok/trunk/doc/groktut/a_second_model/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/a_second_model/versions.cfg
  A   grok/trunk/doc/groktut/a_view_for_a_model/bootstrap.py
  U   grok/trunk/doc/groktut/a_view_for_a_model/buildout.cfg
  A   grok/trunk/doc/groktut/a_view_for_a_model/etc/
  A   grok/trunk/doc/groktut/a_view_for_a_model/etc/README.txt
  A   grok/trunk/doc/groktut/a_view_for_a_model/etc/debug.ini.in
  A   grok/trunk/doc/groktut/a_view_for_a_model/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/a_view_for_a_model/etc/site.zcml.in
  A   grok/trunk/doc/groktut/a_view_for_a_model/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/a_view_for_a_model/etc/zope.conf.in
  U   grok/trunk/doc/groktut/a_view_for_a_model/setup.py
  U   grok/trunk/doc/groktut/a_view_for_a_model/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/a_view_for_a_model/versions.cfg
  A   grok/trunk/doc/groktut/a_view_for_a_model2/bootstrap.py
  U   grok/trunk/doc/groktut/a_view_for_a_model2/buildout.cfg
  A   grok/trunk/doc/groktut/a_view_for_a_model2/etc/
  A   grok/trunk/doc/groktut/a_view_for_a_model2/etc/README.txt
  A   grok/trunk/doc/groktut/a_view_for_a_model2/etc/debug.ini.in
  A   grok/trunk/doc/groktut/a_view_for_a_model2/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/a_view_for_a_model2/etc/site.zcml.in
  A   grok/trunk/doc/groktut/a_view_for_a_model2/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/a_view_for_a_model2/etc/zope.conf.in
  U   grok/trunk/doc/groktut/a_view_for_a_model2/setup.py
  U   grok/trunk/doc/groktut/a_view_for_a_model2/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/a_view_for_a_model2/versions.cfg
  D   grok/trunk/doc/groktut/bootstrap.py
  D   grok/trunk/doc/groktut/buildout.cfg
  D   grok/trunk/doc/groktut/buildout_tut.cfg
  A   grok/trunk/doc/groktut/completely_python_driven_views/bootstrap.py
  U   grok/trunk/doc/groktut/completely_python_driven_views/buildout.cfg
  A   grok/trunk/doc/groktut/completely_python_driven_views/etc/
  A   grok/trunk/doc/groktut/completely_python_driven_views/etc/README.txt
  A   grok/trunk/doc/groktut/completely_python_driven_views/etc/debug.ini.in
  A   grok/trunk/doc/groktut/completely_python_driven_views/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/completely_python_driven_views/etc/site.zcml.in
  A   grok/trunk/doc/groktut/completely_python_driven_views/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/completely_python_driven_views/etc/zope.conf.in
  U   grok/trunk/doc/groktut/completely_python_driven_views/setup.py
  U   grok/trunk/doc/groktut/completely_python_driven_views/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/completely_python_driven_views/versions.cfg
  A   grok/trunk/doc/groktut/containers/bootstrap.py
  U   grok/trunk/doc/groktut/containers/buildout.cfg
  A   grok/trunk/doc/groktut/containers/etc/
  A   grok/trunk/doc/groktut/containers/etc/README.txt
  A   grok/trunk/doc/groktut/containers/etc/debug.ini.in
  A   grok/trunk/doc/groktut/containers/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/containers/etc/site.zcml.in
  A   grok/trunk/doc/groktut/containers/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/containers/etc/zope.conf.in
  U   grok/trunk/doc/groktut/containers/setup.py
  U   grok/trunk/doc/groktut/containers/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/containers/versions.cfg
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/bootstrap.py
  U   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in
  U   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/setup.py
  U   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/versions.cfg
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/bootstrap.py
  U   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in
  U   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/setup.py
  U   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/versions.cfg
  A   grok/trunk/doc/groktut/reading_url_parameters/bootstrap.py
  U   grok/trunk/doc/groktut/reading_url_parameters/buildout.cfg
  A   grok/trunk/doc/groktut/reading_url_parameters/etc/
  A   grok/trunk/doc/groktut/reading_url_parameters/etc/README.txt
  A   grok/trunk/doc/groktut/reading_url_parameters/etc/debug.ini.in
  A   grok/trunk/doc/groktut/reading_url_parameters/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/reading_url_parameters/etc/site.zcml.in
  A   grok/trunk/doc/groktut/reading_url_parameters/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/reading_url_parameters/etc/zope.conf.in
  U   grok/trunk/doc/groktut/reading_url_parameters/setup.py
  U   grok/trunk/doc/groktut/reading_url_parameters/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/reading_url_parameters/versions.cfg
  A   grok/trunk/doc/groktut/redirection/bootstrap.py
  U   grok/trunk/doc/groktut/redirection/buildout.cfg
  A   grok/trunk/doc/groktut/redirection/etc/
  A   grok/trunk/doc/groktut/redirection/etc/README.txt
  A   grok/trunk/doc/groktut/redirection/etc/debug.ini.in
  A   grok/trunk/doc/groktut/redirection/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/redirection/etc/site.zcml.in
  A   grok/trunk/doc/groktut/redirection/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/redirection/etc/zope.conf.in
  U   grok/trunk/doc/groktut/redirection/setup.py
  U   grok/trunk/doc/groktut/redirection/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/redirection/versions.cfg
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/bootstrap.py
  U   grok/trunk/doc/groktut/showing_the_value_in_the_form/buildout.cfg
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/README.txt
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/debug.ini.in
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/site.zcml.in
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/zope.conf.in
  U   grok/trunk/doc/groktut/showing_the_value_in_the_form/setup.py
  U   grok/trunk/doc/groktut/showing_the_value_in_the_form/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/showing_the_value_in_the_form/versions.cfg
  A   grok/trunk/doc/groktut/simple_forms/bootstrap.py
  U   grok/trunk/doc/groktut/simple_forms/buildout.cfg
  A   grok/trunk/doc/groktut/simple_forms/etc/
  A   grok/trunk/doc/groktut/simple_forms/etc/README.txt
  A   grok/trunk/doc/groktut/simple_forms/etc/debug.ini.in
  A   grok/trunk/doc/groktut/simple_forms/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/simple_forms/etc/site.zcml.in
  A   grok/trunk/doc/groktut/simple_forms/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/simple_forms/etc/zope.conf.in
  U   grok/trunk/doc/groktut/simple_forms/setup.py
  U   grok/trunk/doc/groktut/simple_forms/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/simple_forms/versions.cfg
  A   grok/trunk/doc/groktut/storing_data/bootstrap.py
  U   grok/trunk/doc/groktut/storing_data/buildout.cfg
  A   grok/trunk/doc/groktut/storing_data/etc/
  A   grok/trunk/doc/groktut/storing_data/etc/README.txt
  A   grok/trunk/doc/groktut/storing_data/etc/debug.ini.in
  A   grok/trunk/doc/groktut/storing_data/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/storing_data/etc/site.zcml.in
  A   grok/trunk/doc/groktut/storing_data/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/storing_data/etc/zope.conf.in
  U   grok/trunk/doc/groktut/storing_data/setup.py
  U   grok/trunk/doc/groktut/storing_data/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/storing_data/versions.cfg
  A   grok/trunk/doc/groktut/template/
  A   grok/trunk/doc/groktut/template/bootstrap.py
  A   grok/trunk/doc/groktut/template/buildout.cfg
  A   grok/trunk/doc/groktut/template/etc/
  A   grok/trunk/doc/groktut/template/etc/README.txt
  A   grok/trunk/doc/groktut/template/etc/debug.ini.in
  A   grok/trunk/doc/groktut/template/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/template/etc/site.zcml.in
  A   grok/trunk/doc/groktut/template/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/template/etc/zope.conf.in
  A   grok/trunk/doc/groktut/template/setup.py
  A   grok/trunk/doc/groktut/template/src/
  A   grok/trunk/doc/groktut/template/src/sample/
  A   grok/trunk/doc/groktut/template/src/sample/__init__.py
  A   grok/trunk/doc/groktut/template/src/sample/app.py
  A   grok/trunk/doc/groktut/template/src/sample/app_templates/
  A   grok/trunk/doc/groktut/template/src/sample/app_templates/index.pt
  A   grok/trunk/doc/groktut/template/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/template/versions.cfg
  A   grok/trunk/doc/groktut/the_rules_of_persistence/bootstrap.py
  U   grok/trunk/doc/groktut/the_rules_of_persistence/buildout.cfg
  A   grok/trunk/doc/groktut/the_rules_of_persistence/etc/
  A   grok/trunk/doc/groktut/the_rules_of_persistence/etc/README.txt
  A   grok/trunk/doc/groktut/the_rules_of_persistence/etc/debug.ini.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence/etc/site.zcml.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence/etc/zope.conf.in
  U   grok/trunk/doc/groktut/the_rules_of_persistence/setup.py
  U   grok/trunk/doc/groktut/the_rules_of_persistence/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/the_rules_of_persistence/versions.cfg
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/bootstrap.py
  U   grok/trunk/doc/groktut/the_rules_of_persistence2/buildout.cfg
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/etc/
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/etc/README.txt
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/etc/debug.ini.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/etc/site.zcml.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/etc/zope.conf.in
  U   grok/trunk/doc/groktut/the_rules_of_persistence2/setup.py
  U   grok/trunk/doc/groktut/the_rules_of_persistence2/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/the_rules_of_persistence2/versions.cfg
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/bootstrap.py
  U   grok/trunk/doc/groktut/the_rules_of_persistence3/buildout.cfg
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/etc/
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/etc/README.txt
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/etc/debug.ini.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/etc/site.zcml.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/etc/zope.conf.in
  U   grok/trunk/doc/groktut/the_rules_of_persistence3/setup.py
  U   grok/trunk/doc/groktut/the_rules_of_persistence3/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/the_rules_of_persistence3/versions.cfg
  U   grok/trunk/doc/tutorial.rst

-=-

Property changes on: grok/trunk/doc/groktut
___________________________________________________________________
Modified: svn:ignore
   - develop-eggs
eggs
bin
buildout
parts
.installed.cfg

*.pyc
*.pyo

   + 


Deleted: grok/trunk/doc/groktut/INSTALL.txt
===================================================================
--- grok/trunk/doc/groktut/INSTALL.txt	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/INSTALL.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,40 +0,0 @@
-Grok Tutorial Samples installation
-----------------------------------
-
-To run the Grok tutorial samples we are going to assume you've already
-used an up to date version of grokproject to set up your buildout
-environment, including a shared eggs directory. If you haven't, the
-procedure below will try to download the required eggs over and over
-again, which is not very desirable.
-
-One way to make the tutorials build quickly is to have a centrally
-installed version of buildout, for instance in your homedirectory's
-``bin`` directory. If so you can just change directory into the
-directories for each tutorial and run ``buildout -N`` there.
-
-Alternatively we can install buildout here specifically for the
-tutorials. Just type this in the ``groktut`` directory::
-
-  $ python2.4 bootstrap.py
-
-This will download and install buildout in the ``groktut`` directory.
-
-Now you can go to the tutorial sample you'd like to look at and launch
-buildout::
-
-  $ cd an_empty_grok_project
-  $ ../buildout -N
-
-The ``-N`` option tells the buildout_ system not to look for newer
-files on the network. This greatly speeds up the buildout process if
-you have all required eggs already available.
-
-You will have a separate Zope instance created for you in each
-tutorial directory you run the buildout script. From the specific
-tutorial directory, you can start up Zope like this::
-
-  $ bin/instance fg
-
-Zope should then be running on port 8080 (http://localhost:8080).
-
-Just Ctrl-C when you're done.

Added: grok/trunk/doc/groktut/a_second_model/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/a_second_model/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/a_second_model/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/a_second_model/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/a_second_model/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_second_model/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/a_second_model/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/a_second_model/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/a_second_model/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/a_second_model/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/a_second_model/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_second_model/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/a_second_model/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/a_second_model/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_second_model/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/a_second_model/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/a_second_model/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_second_model/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/a_second_model/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/a_second_model/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_second_model/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/a_second_model/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/a_second_model/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_second_model/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/a_second_model/setup.py
===================================================================
--- grok/trunk/doc/groktut/a_second_model/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_second_model/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/a_second_model/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/a_second_model/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_second_model/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/a_second_model/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/a_second_model/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/a_second_model/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/a_view_for_a_model/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/a_view_for_a_model/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_view_for_a_model/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/a_view_for_a_model/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/a_view_for_a_model/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/a_view_for_a_model/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/a_view_for_a_model/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/a_view_for_a_model/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/a_view_for_a_model/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/a_view_for_a_model/setup.py
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_view_for_a_model/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/a_view_for_a_model/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_view_for_a_model/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/a_view_for_a_model/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/a_view_for_a_model2/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/a_view_for_a_model2/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/a_view_for_a_model2/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/a_view_for_a_model2/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/a_view_for_a_model2/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/a_view_for_a_model2/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/a_view_for_a_model2/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/a_view_for_a_model2/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/a_view_for_a_model2/setup.py
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/a_view_for_a_model2/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/a_view_for_a_model2/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/a_view_for_a_model2/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/a_view_for_a_model2/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Deleted: grok/trunk/doc/groktut/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/bootstrap.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,52 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Bootstrap a buildout-based project
-
-Simply run this script in a directory containing a buildout.cfg.
-The script accepts buildout command-line options, so you can
-use the -c option to specify an alternate configuration file.
-
-$Id: bootstrap.py 69908 2006-08-31 21:53:00Z jim $
-"""
-
-import os, shutil, sys, tempfile, urllib2
-
-tmpeggs = tempfile.mkdtemp()
-
-ez = {}
-exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
-                     ).read() in ez
-ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
-
-import pkg_resources
-
-cmd = 'from setuptools.command.easy_install import main; main()'
-if sys.platform == 'win32':
-    cmd = '"%s"' % cmd # work around spawn lamosity on windows
-
-ws = pkg_resources.working_set
-assert os.spawnle(
-    os.P_WAIT, sys.executable, sys.executable,
-    '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
-    dict(os.environ,
-         PYTHONPATH=
-         ws.find(pkg_resources.Requirement.parse('setuptools')).location
-         ),
-    ) == 0
-
-ws.add_entry(tmpeggs)
-ws.require('zc.buildout')
-import zc.buildout.buildout
-zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
-shutil.rmtree(tmpeggs)

Deleted: grok/trunk/doc/groktut/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,8 +0,0 @@
-[buildout]
-parts = buildout-script
-bin-directory = .
-
-[buildout-script]
-recipe = zc.recipe.egg
-eggs = zc.buildout
-scripts = buildout=buildout

Deleted: grok/trunk/doc/groktut/buildout_tut.cfg
===================================================================
--- grok/trunk/doc/groktut/buildout_tut.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/buildout_tut.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,52 +0,0 @@
-[buildout]
-parts = data app zopectl test
-
-[data]
-recipe = zc.recipe.filestorage
-
-[app]
-recipe = zc.zope3recipes>=0.5.3:application
-eggs = sample
-site.zcml = <include package="sample" />
-            <include package="zope.app.twisted" />
-
-            <unauthenticatedPrincipal id="zope.anybody"
-                                      title="Unauthenticated User" />
-            <unauthenticatedGroup id="zope.Anybody"
-                                  title="Unauthenticated Users" />
-            <authenticatedGroup id="zope.Authenticated"
-                                title="Authenticated Users" />
-            <everybodyGroup id="zope.Everybody"
-                            title="All Users" />
-            <principal id="zope.manager"
-                       title="Manager"
-                       login="grok"
-                       password_manager="Plain Text"
-                       password="grok"
-                       />
-
-            <!-- Replace the following directive if you don't want
-                 public access -->
-            <grant permission="zope.View"
-                   principal="zope.Anybody" />
-            <grant permission="grok.View"
-                   principal="zope.Anybody" />
-            <grant permission="zope.app.dublincore.view"
-                   principal="zope.Anybody" />
-
-            <role id="zope.Manager" title="Site Manager" />
-            <role id="zope.Member" title="Site Member" />
-            <grantAll role="zope.Manager" />
-            <grant role="zope.Manager"
-                   principal="zope.manager" />
-
-# this section named so that the start/stop script is called bin/zopectl
-[zopectl]
-recipe = zc.zope3recipes:instance
-application = app
-zope.conf = ${data:zconfig}
-
-[test]
-recipe = zc.recipe.testrunner
-eggs = sample
-defaults = ['--tests-pattern', '^f?tests$', '-v']

Added: grok/trunk/doc/groktut/completely_python_driven_views/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/completely_python_driven_views/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/completely_python_driven_views/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/completely_python_driven_views/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/completely_python_driven_views/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/completely_python_driven_views/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/completely_python_driven_views/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/completely_python_driven_views/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/completely_python_driven_views/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/completely_python_driven_views/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/completely_python_driven_views/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/completely_python_driven_views/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/completely_python_driven_views/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/completely_python_driven_views/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/completely_python_driven_views/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/completely_python_driven_views/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/completely_python_driven_views/setup.py
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/completely_python_driven_views/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/completely_python_driven_views/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/completely_python_driven_views/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/completely_python_driven_views/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/completely_python_driven_views/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/completely_python_driven_views/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/containers/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/containers/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/containers/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/containers/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/containers/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/containers/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/containers/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/containers/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/containers/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/containers/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/containers/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/containers/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/containers/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/containers/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/containers/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/containers/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/containers/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/containers/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/containers/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/containers/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/containers/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/containers/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/containers/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/containers/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/containers/setup.py
===================================================================
--- grok/trunk/doc/groktut/containers/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/containers/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/containers/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/containers/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/containers/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/containers/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/containers/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/containers/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/setup.py
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/doing_some_calculation_before_viewing_a_page/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/setup.py
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/explicitly_associating_a_view_with_a_model/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/reading_url_parameters/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/reading_url_parameters/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/reading_url_parameters/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/reading_url_parameters/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/reading_url_parameters/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/reading_url_parameters/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/reading_url_parameters/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/reading_url_parameters/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/reading_url_parameters/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/reading_url_parameters/setup.py
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/reading_url_parameters/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/reading_url_parameters/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/reading_url_parameters/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/reading_url_parameters/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/redirection/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/redirection/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/redirection/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/redirection/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/redirection/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/redirection/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/redirection/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/redirection/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/redirection/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/redirection/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/redirection/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/redirection/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/redirection/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/redirection/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/redirection/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/redirection/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/redirection/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/redirection/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/redirection/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/redirection/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/redirection/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/redirection/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/redirection/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/redirection/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/redirection/setup.py
===================================================================
--- grok/trunk/doc/groktut/redirection/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/redirection/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/redirection/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/redirection/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/redirection/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/redirection/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/redirection/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/redirection/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/showing_the_value_in_the_form/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/showing_the_value_in_the_form/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/showing_the_value_in_the_form/setup.py
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/showing_the_value_in_the_form/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/showing_the_value_in_the_form/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/showing_the_value_in_the_form/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/showing_the_value_in_the_form/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/simple_forms/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/simple_forms/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/simple_forms/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/simple_forms/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/simple_forms/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/simple_forms/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/simple_forms/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/simple_forms/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/simple_forms/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/simple_forms/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/simple_forms/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/simple_forms/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/simple_forms/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/simple_forms/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/simple_forms/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/simple_forms/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/simple_forms/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/simple_forms/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/simple_forms/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/simple_forms/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/simple_forms/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/simple_forms/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/simple_forms/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/simple_forms/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/simple_forms/setup.py
===================================================================
--- grok/trunk/doc/groktut/simple_forms/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/simple_forms/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/simple_forms/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/simple_forms/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/simple_forms/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/simple_forms/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/simple_forms/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/simple_forms/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/storing_data/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/storing_data/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/storing_data/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/storing_data/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/storing_data/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/storing_data/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/storing_data/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/storing_data/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/storing_data/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/storing_data/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/storing_data/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/storing_data/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/storing_data/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/storing_data/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/storing_data/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/storing_data/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/storing_data/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/storing_data/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/storing_data/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/storing_data/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/storing_data/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/storing_data/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/storing_data/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/storing_data/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/storing_data/setup.py
===================================================================
--- grok/trunk/doc/groktut/storing_data/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/storing_data/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/storing_data/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/storing_data/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/storing_data/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/storing_data/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/storing_data/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/storing_data/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/template/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/template/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/template/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Added: grok/trunk/doc/groktut/template/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/template/buildout.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/template/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,80 @@
+[buildout]
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/template/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/template/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/template/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/template/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/template/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/template/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/template/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/template/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/template/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/template/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/template/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/template/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/template/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/template/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/template/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/template/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/template/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/template/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Added: grok/trunk/doc/groktut/template/setup.py
===================================================================
--- grok/trunk/doc/groktut/template/setup.py	                        (rev 0)
+++ grok/trunk/doc/groktut/template/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,35 @@
+from setuptools import setup, find_packages
+
+version = '0.0'
+
+setup(name='Sample',
+      version=version,
+      description="",
+      long_description="""\
+""",
+      # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[], 
+      keywords="",
+      author="",
+      author_email="",
+      url="",
+      license="",
+      package_dir={'': 'src'},
+      packages=find_packages('src'),
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=['setuptools',
+                        'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
+                        # Add extra requirements here
+                        ],
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
+      """,
+      )

Added: grok/trunk/doc/groktut/template/src/sample/__init__.py
===================================================================
--- grok/trunk/doc/groktut/template/src/sample/__init__.py	                        (rev 0)
+++ grok/trunk/doc/groktut/template/src/sample/__init__.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1 @@
+# this directory is a package

Added: grok/trunk/doc/groktut/template/src/sample/app.py
===================================================================
--- grok/trunk/doc/groktut/template/src/sample/app.py	                        (rev 0)
+++ grok/trunk/doc/groktut/template/src/sample/app.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,7 @@
+import grok
+
+class Sample(grok.Application, grok.Container):
+    pass
+
+class Index(grok.View):
+    pass # see app_templates/index.pt

Added: grok/trunk/doc/groktut/template/src/sample/app_templates/index.pt
===================================================================
--- grok/trunk/doc/groktut/template/src/sample/app_templates/index.pt	                        (rev 0)
+++ grok/trunk/doc/groktut/template/src/sample/app_templates/index.pt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,11 @@
+<html>
+<head>
+</head>
+<body>
+  <h1>Congratulations!</h1>
+
+  <p>Your Grok application is up and running.
+  Edit <code>sample/app_templates/index.pt</code> to change
+  this page.</p>
+</body>
+</html>

Added: grok/trunk/doc/groktut/template/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/template/src/sample/configure.zcml	                        (rev 0)
+++ grok/trunk/doc/groktut/template/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,6 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:grok="http://namespaces.zope.org/grok">
+  <include package="grok" />
+  <includeDependencies package="." />
+  <grok:grok package="." />
+</configure>

Added: grok/trunk/doc/groktut/template/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/template/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/template/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/the_rules_of_persistence/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/the_rules_of_persistence/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/the_rules_of_persistence/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/the_rules_of_persistence/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/the_rules_of_persistence/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/the_rules_of_persistence/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/the_rules_of_persistence/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/the_rules_of_persistence/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/the_rules_of_persistence/setup.py
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/the_rules_of_persistence/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/the_rules_of_persistence/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/the_rules_of_persistence2/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/the_rules_of_persistence2/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/the_rules_of_persistence2/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/the_rules_of_persistence2/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/the_rules_of_persistence2/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/the_rules_of_persistence2/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/the_rules_of_persistence2/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/the_rules_of_persistence2/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/the_rules_of_persistence2/setup.py
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/the_rules_of_persistence2/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/the_rules_of_persistence2/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence2/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence2/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Added: grok/trunk/doc/groktut/the_rules_of_persistence3/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/bootstrap.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+import os, shutil, sys, tempfile, urllib2, logging
+
+def remove_old_logger_handlers():
+    # zc.buildout installs a new log stream on every call of
+    # main(). We remove any leftover handlers to avoid multiple output
+    # of same content (doubled lines etc.)
+    root_logger = logging.getLogger()
+    if 'zc.buildout' in root_logger.manager.loggerDict.keys():
+        logger = logging.getLogger('zc.buildout')
+        for handler in logger.handlers:
+            logger.removeHandler(handler)
+    return
+
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, quote (sys.executable),
+    '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+remove_old_logger_handlers()
+shutil.rmtree(tmpeggs)
+
+# grokproject specific addition to standard bootstrap.py:
+# Install eggbasket too.  This should be verbose to give the user
+# information about what is happening, since this can take a while.
+zc.buildout.buildout.main(sys.argv[1:] + ['-v', 'install', 'eggbasket'])
+if sys.platform == 'win32':
+    print "Now you can run 'bin\buildout.exe'"
+else:
+    print "Now you can run 'bin/buildout'"

Modified: grok/trunk/doc/groktut/the_rules_of_persistence3/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/buildout.cfg	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/buildout.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,3 +1,80 @@
 [buildout]
-develop = . ../../..
-extends = ../buildout_tut.cfg
\ No newline at end of file
+develop = .
+parts = eggbasket app i18n test data log zpasswd
+        zope_conf site_zcml zdaemon_conf deploy_ini debug_ini
+newest = false
+find-links = http://download.zope.org/distribution/
+extends = versions.cfg
+# eggs will be installed in the default buildout location
+# (see .buildout/default.cfg in your home directory)
+# unless you specify an eggs-directory option here.
+
+versions = versions
+
+[app]
+recipe = zc.recipe.egg
+eggs = Sample
+       z3c.evalexception>=2.0
+       Paste
+       PasteScript
+       PasteDeploy
+interpreter = python-console
+
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = Sample
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+
+# this section named so that the i18n scripts are called bin/i18n...
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+packages = sample
+eggs = sample
+domain = sample
+output = src/sample/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = Sample
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = z3c.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+
+[site_zcml]
+recipe = z3c.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = z3c.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = z3c.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = z3c.recipe.template
+input = etc/debug.ini.in
+output = ${buildout:parts-directory}/etc/debug.ini
+
+
+[eggbasket]
+recipe = z3c.recipe.eggbasket
+eggs = grok
+url = http://grok.zope.org/releaseinfo/grok-eggs-1.0a4.tgz

Added: grok/trunk/doc/groktut/the_rules_of_persistence3/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/etc/README.txt	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,26 @@
+In this directory you can find templates which are used by
+``zc.buildout`` to create the configuration files in the parts/etc/ subdir
+of your project.
+
+If you modify files in this directory, you have to run::
+
+  $ bin/buildout
+
+afterwards to rebuild the configuration files in parts/etc/.
+
+In the templates you can use placesholders recognized by zc.buildout
+to name local paths, etc. A zc.buildout placeholder looks like this::
+
+  ${buildout:directory}
+
+which gives you the path of the project directory and will be
+substituted with the real path when you run buildout the next
+time. The set of available placeholders depends on your
+buildout.cfg.
+
+You can also modify files in parts/etc directly, but those changes
+will be overwritten after running bin/buildout the next time.
+
+To run your project you can do::
+
+  $ bin/paster serve parts/etc/deploy.ini

Added: grok/trunk/doc/groktut/the_rules_of_persistence3/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/etc/debug.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,66 @@
+# debug.ini
+#
+# Debugging configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[filter-app:main]
+# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
+# on the console:
+use = egg:z3c.evalexception#ajax
+next = zope
+
+[app:zope]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf
\ No newline at end of file

Added: grok/trunk/doc/groktut/the_rules_of_persistence3/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/etc/deploy.ini.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,60 @@
+# deploy.ini
+#
+# Deployment configuration for use with paster/WSGI
+#
+
+[loggers]
+keys = root, wsgi
+
+[handlers]
+keys = console, accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_wsgi]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${buildout:directory}', 'parts', 'log', 'access.log'),
+        'a')
+level = INFO
+formatter = accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
+
+[filter:translogger]
+use = egg:Paste#translogger
+setup_console_handler = False
+logger_name = wsgi
+
+[app:main]
+use = egg:Sample
+filter-with = translogger
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[DEFAULT]
+# set the name of the zope.conf file
+zope_conf = %(here)s/zope.conf

Added: grok/trunk/doc/groktut/the_rules_of_persistence3/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/etc/site.zcml.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="sample">
+
+  <include package="sample" />
+
+    <configure i18n_domain="sample">
+    
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="grok"
+                 password_manager="SHA1"
+                 password="8977f073739bd029629243732eb682db005a7541f7509622"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Anybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Anybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>

Added: grok/trunk/doc/groktut/the_rules_of_persistence3/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/etc/zdaemon.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,8 @@
+<runner>
+  program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+  daemon on
+  transcript ${buildout:directory}/parts/log/zdaemon.log
+  socket-name ${buildout:directory}/parts/log/zdaemonsock
+  # Enable this to run the child process as a different user
+  # user zope
+</runner>

Added: grok/trunk/doc/groktut/the_rules_of_persistence3/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/etc/zope.conf.in	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,42 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+  # Standard Filestorage
+  <filestorage>
+    path ${data:path}
+  </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 a file.
+  # The "path" setting can be a relative or absolute
+  # filesystem path.
+
+  <logfile>
+    path ${buildout:directory}/parts/log/z3.log
+    formatter zope.exceptions.log.Formatter
+  </logfile>
+
+  # This sets up logging to to standard output.
+  # The "path" setting can be the tokens STDOUT or STDERR
+  
+#  <logfile>
+#    path STDOUT
+#    formatter zope.exceptions.log.Formatter
+#  </logfile>
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
\ No newline at end of file

Modified: grok/trunk/doc/groktut/the_rules_of_persistence3/setup.py
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/setup.py	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/setup.py	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = 0.0
+version = '0.0'
 
 setup(name='Sample',
       version=version,
@@ -20,9 +20,16 @@
       zip_safe=False,
       install_requires=['setuptools',
                         'grok',
+                        'grokui.admin',
+                        'z3c.testsetup',
+                        'grokcore.startup',
                         # Add extra requirements here
                         ],
-      entry_points="""
-      # Add entry points here
+      entry_points = """
+      [console_scripts]
+      sample-debug = grokcore.startup:interactive_debug_prompt
+      sample-ctl = grokcore.startup:zdaemon_controller
+      [paste.app_factory]
+      main = grokcore.startup:application_factory
       """,
       )

Modified: grok/trunk/doc/groktut/the_rules_of_persistence3/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/src/sample/configure.zcml	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/src/sample/configure.zcml	2009-08-31 17:26:31 UTC (rev 103416)
@@ -1,5 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:grok="http://namespaces.zope.org/grok">
   <include package="grok" />
+  <includeDependencies package="." />
   <grok:grok package="." />
 </configure>

Added: grok/trunk/doc/groktut/the_rules_of_persistence3/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/the_rules_of_persistence3/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/the_rules_of_persistence3/versions.cfg	2009-08-31 17:26:31 UTC (rev 103416)
@@ -0,0 +1,136 @@
+# This file contains a list of versions of the various grok modules that
+# belong together.
+# It was downloaded from http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0a4
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.6
+grokcore.formlib = 1.1
+grokcore.security = 1.0
+grokcore.view = 1.7
+grokcore.viewlet = 1.0
+grokui.admin = 0.3.2
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.6.0
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
+
+
+# Here we pin the recipes and other packages that are not in the
+# downloaded versions.cfg of grok
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+setuptools = 0.6c9
+z3c.evalexception = 2.0
+z3c.recipe.eggbasket = 0.4.1
+z3c.recipe.i18n = 0.5.0
+z3c.recipe.template = 0.1
+zc.buildout = 1.1.1
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+grokcore.startup = 0.2
+
+

Modified: grok/trunk/doc/tutorial.rst
===================================================================
--- grok/trunk/doc/tutorial.rst	2009-08-31 16:23:16 UTC (rev 103415)
+++ grok/trunk/doc/tutorial.rst	2009-08-31 17:26:31 UTC (rev 103416)
@@ -21,10 +21,9 @@
     http://wiki.zope.org/ZPT/FrontPage
 
   Note that some of the information in these introductions may refer
-  to concepts not available in Grok or Zope 3, in particular variables
-  like ``here`` or ``template``. The basic principles will work with
-  Zope 3 (and Grok) however; try reading ``context`` or ``view``
-  instead.
+  to concepts not available in Grok or the Zope Toolkit, in particular
+  variables like ``here`` or ``template``. The basic principles will
+  work with Grok however; try reading ``context`` or ``view`` instead.
 
 Grok is a powerful and flexible web application framework for Python
 developers. In this tutorial we will show you the various things you
@@ -223,7 +222,7 @@
 download and install the Zope Toolkit libraries as well as Grok into
 the project area.
 
-Grok asks you for an initial username and password for the Zope
+Grok asks you for an initial username and password for the
 server. We'll use ``grok`` for both::
 
   Enter user (Name of an initial administrator user): grok
@@ -240,7 +239,7 @@
   One common problem when installing Grok is library mixup. You may
   have some libraries installed in your Python interpreter that
   conflict with libraries that Grok wants to install. You tend to get
-  an error when starting up the Grok webserver when this is the
+  an error when starting up the Grok web server when this is the
   case. If you already have installed Zope Toolkit libraries (or Zope
   3) previously for instance, you may first have to remove these
   libraries from your Python's ``site-packages`` directory. 
@@ -312,7 +311,7 @@
 
 Alternatively, you can use the --reload flag to start up paster with a
 monitor that scans your code base (python files only) for changes and
-automatically restarts the Zope server every time you make a change::
+automatically restarts the server every time you make a change::
 
   $ bin/paster serve --reload parts/etc/deploy.ini
 
@@ -401,20 +400,20 @@
 Showing pages
 =============
 
-Showing web pages is what puts the *web* in "web applications". You
-start doing this with HTML templates, but Grok doesn't stop at
-templates. Most web pages in a web application will contain complex
-presentation logic that is better handled by separate Python code in
-conjunction with templates. This becomes especially important in more
-complex interactions with the user, such as form handling. After
-reading this chapter, you should already be able to write simple web
-applications with Grok.
+Showing web pages is what puts the *web* in "web
+applications". Typically HTML templates are used for this, but Grok
+doesn't stop at templates. Most web pages in a real-world web
+application will contain complex presentation logic that is better
+handled by separate Python code in conjunction with templates. This
+becomes especially important in more complex interactions with the
+user, such as form handling. After reading this chapter, you should
+already be able to write simple web applications with Grok.
 
 Publishing a simple web page
 ----------------------------
 
 Let's publish a simple static web page. Grok is geared towards web
-applications and therefore not really meant for publishing a large
+applications and therefore is not really meant for publishing a large
 number of static (pregenerated) web pages. For that you're better off
 to use a specialized system such as Apache. Nonetheless, in order to
 develop any web application we need to know how to put some simple
@@ -449,8 +448,8 @@
   Hello world!
 
 Note that you can change templates and see the effects instantly:
-there is no need to restart Zope to see the effect. This is not true
-for changes on the Python level, for instance when you add a
+there is no need to restart the web server to see the effect. This is
+not true for changes on the Python level, for instance when you add a
 template. We show an example of this next.
 
 A second view
@@ -501,8 +500,9 @@
 
   .. _`megrok.genshi`: http://pypi.python.org/pypi/megrok.genshi/
 
-Restart Zope (``CTRL-C``, then ``bin/paster serve parts/etc/deploy.ini``). You can now 
-go to a new web page called ``bye``:
+Restart the web server (``CTRL-C``, then ``bin/paster serve
+parts/etc/deploy.ini``). You can now go to a new web page called
+``bye``:
 
   http://localhost:8080/test/bye
 
@@ -529,8 +529,8 @@
 content between the ``<p>`` and ``</p>`` tags with something else, in
 this case the result of the Python expression ``1 + 1``.
 
-Since restarting Zope is not necessary for changes that are limited to
-the page templates, you can just reload the web page:
+Since restarting the server is not necessary for changes that are
+limited to the page templates, you can just reload the web page:
 
   http://localhost:8080/test
 
@@ -570,7 +570,7 @@
 .. include:: groktut/static_resources_for_our_web_page/src/sample/app_templates/index.pt
   :literal:
 
-Now restart Zope and reload the page:
+Now restart the server and reload the page:
 
   http://localhost:8080/test
 
@@ -613,7 +613,7 @@
   template called ``bye.pt`` in your ``app_templates`` directory.
   Since in the given ``app.py`` we we have no more class using it, the
   ``bye.pt`` template will have become *unassociated*. When you try to
-  restart Zope, Grok will give you a warning like this::
+  restart the server, Grok will give you a warning like this::
 
     UserWarning: Found the following unassociated template(s) when
     grokking 'sample.app': bye.  Define view classes inheriting from
@@ -633,7 +633,7 @@
 what works::
 
   $ python
-  Python 2.4.4
+  Python 2.5.2
   Type "help", "copyright", "credits" or "license" for more information.
   >>> 
 
@@ -677,7 +677,7 @@
 .. include:: groktut/using_view_methods/src/sample/app_templates/index.pt
   :literal:
 
-Restart Zope. This is needed as we changed the content of a Python
+Restart the server. This is needed as we changed the content of a Python
 file (``app.py``). Now reload our index page to see whether it worked:
 
   http://localhost:8080/test
@@ -688,9 +688,9 @@
   2007-02-27 17:21
 
 What happened here? When viewing a page, the view class (in this case
-``Index`` is instantiated by Zope. The name ``view`` in the template
-is always made available and is associated with this instance. We then
-simply call the method on it in our template.
+``Index`` is instantiated by the framework. The name ``view`` in the
+template is always made available and is associated with this
+instance. We then simply call the method on it in our template.
 
 There is another way to write the template that is slightly shorter
 and may be easier to read in some cases, using a ZPT path expression::
@@ -762,7 +762,7 @@
 .. include:: groktut/completely_python_driven_views/src/sample/app.py
   :literal:
 
-If you were to start up Zope with an ``index.pt`` template still
+If you were to start up the server with an ``index.pt`` template still
 inside ``app_templates`` you would get an error::
 
     GrokError: Multiple possible ways to render view <class
@@ -808,7 +808,7 @@
 .. include:: groktut/doing_some_calculation_before_viewing_a_page/src/sample/app_templates/index.pt
   :literal:
 
-Restart Zope and then let's take another look at our application:
+Restart the server and then let's take another look at our application:
 
   http://localhost:8080/test
 
@@ -838,7 +838,7 @@
 .. include:: groktut/reading_url_parameters/src/sample/app_templates/index.pt
   :literal:
 
-Restart Zope. Now going to the following URL should display 8:
+Restart the server. Now going to the following URL should display 8:
 
   http://localhost:8080/test?value1=3&value2=5
 
@@ -851,7 +851,7 @@
 
   http://localhost:8080/test
 
-You can look at the window where you started up Zope to see the error
+You can look at the window where you started up the server to see the error
 traceback. This is the relevant complaint::
 
   TypeError: Missing argument to update(): value1
@@ -861,7 +861,7 @@
 .. include:: groktut/reading_url_parameters2/src/sample/app.py
   :literal:
 
-Restart Zope, and see it can now deal with missing parameters (they
+Restart the server, and see it can now deal with missing parameters (they
 default to ``0``).
 
 Simple forms
@@ -871,8 +871,8 @@
 
   Creating forms and converting and validating user input by hand, as
   shown in this section, can be rather cumbersome. With Grok, you can
-  use Zope 3's *schema* and *formlib* systems to automate this and
-  more. This will be discussed in a later section. XXX
+  use the Zope Toolkit's *schema* and *formlib* systems to automate
+  this and more. This will be discussed in a later section. TDB
 
 Entering the parameters through URLs is not very pretty. Let's use a
 form for this instead. Change ``index.pt`` to contain a form, like
@@ -914,7 +914,7 @@
 sum". If we don't get any error, the conversion to integer was fine,
 and we can display the sum.
 
-Restart Zope and go to the form again to try it out:
+Restart the server and go to the form again to try it out:
 
   http://localhost:8080/test
 
@@ -956,7 +956,7 @@
 .. include:: groktut/a_view_for_a_model/src/sample/app_templates/index.pt
   :literal:
 
-Restart Zope. When you view the page:
+Restart the server. When you view the page:
 
   http://localhost:8080/test
 
@@ -1006,7 +1006,7 @@
 .. include:: groktut/a_view_for_a_model2/src/sample/app_templates/index.pt
   :literal:
 
-Restart Zope. When you view the page:
+Restart the server. When you view the page:
 
   http://localhost:8080/test
 
@@ -1022,7 +1022,7 @@
 So far we have only displayed either hardcoded data, or calculations
 based on end-user input. What if we actually want to *store* some
 information, such as something the user entered? The easiest way to do
-this with Zope is to use the Zope Object Database (ZODB).
+this with Grok is to use the Zope Object Database (ZODB).
 
 The ZODB is a database of Python objects. You can store any Python
 object in it, though you do need to follow a few simple rules (the
@@ -1062,7 +1062,7 @@
 This template display a form asking for a bit of text. It submits to
 itself.
 
-Restart Zope. Let's first view the index page:
+Restart the server. Let's first view the index page:
 
   http://localhost:8080/test
 
@@ -1080,7 +1080,7 @@
 You should now see the text you just entered on the page. This means
 that your text was successfully stored in the object database!
 
-You can even restart Zope and go back to the index page, and your text
+You can even restart the server and go back to the index page, and your text
 should still be there.
 
 Redirection
@@ -1202,16 +1202,16 @@
 
   What to do when you change an object's storage structure while your
   application is already in production? In a later section, we will
-  introduce Zope 3's object evolution mechanism that allows you to
-  update objects in an existing object database. XXX
+  introduce Zope Toolkit's object evolution mechanism that allows you to
+  update objects in an existing object database. TDB
 
-Let's restart our Zope application. If you have followed the tutorial
-from the last section, you will now see an error when you look at the
-front page of the application::
+Let's restart the server. If you have followed the tutorial from the
+last section, you will now see an error when you look at the front
+page of the application::
 
   A system error occurred. 
 
-Look at the output Zope gave when we tried to load our page::
+Look at the output we got when we tried to load our page::
 
   AttributeError: 'Sample' object has no attribute 'list'
 
@@ -1237,7 +1237,7 @@
 texts appear on the ``index`` page.
 
 Everything is just fine now, right? In fact, not so! Now we will get
-to our bug. Restart Zope and look at the index page again:
+to our bug. Restart the server and look at the index page again:
 
   http://localhost:8080/test
 
@@ -1265,8 +1265,8 @@
         mydata = []
 
   Appending an item to mydata (through ``self.mydata.append('bar')``,
-  for instance) have an effect, but only until you restart Zope. Then
-  your changes will be lost.
+  for instance) have an effect, but only until you restart the
+  server. Then your changes will be lost.
 
   It is good Python design practice not to use mutable class-data, so
   this property of the ZODB shouldn't cramp your style.
@@ -1276,12 +1276,12 @@
 .. include:: groktut/the_rules_of_persistence2/src/sample/app.py
   :literal:
 
-We've now told Zope that the context object has changed (because we
-modified a mutable sub-object), by adding the line::
+We've now told the server that the context object has changed (because
+we modified a mutable sub-object), by adding the line::
 
   self.context._p_changed = True
 
-If you now add some texts and then restart Zope, you will notice the
+If you now add some texts and then restart the server, you will notice the
 data is still there: it has successfully been stored in the object
 database.
 
@@ -1338,7 +1338,7 @@
 
   Curious now about how to combine models into a single application?
   Can't wait? Look at the section `Containers` coming up next, or
-  `Traversal` later on.
+  `Traversal` later on. TDB
 
 We will now extend our application with a second model. Since we
 haven't explained yet how to combine models together into a single
@@ -1378,7 +1378,7 @@
 views with models. We actually *have* to do this here, as Grok refuses
 to guess in the face of ambiguity. Without the use of
 ``grok.context``, we would have seen an error like this when we start
-up Zope::
+up::
 
   GrokError: Multiple possible contexts for <class
   'sample.app.AnotherIndex'>, please use grok.context.
@@ -1396,8 +1396,8 @@
 ``grok.name``. We can use it on both view classes
 (``grok.name('index')``) to explicitly explain to Grok what we want.
 
-You can now try to restart Zope and create both applications in the
-Grok Admin interface. They should display the correct index pages
+You can now try to restart the server and create both applications in
+the Grok Admin interface. They should display the correct index pages
 when you look at them.
 
 We can see that the introduction of a second model has complicated our
@@ -1429,7 +1429,7 @@
 to use `_p_changed` anywhere to notice you changed them. They also
 send out special events that you can listen to when items are placed
 in them or removed from them. For more on that, see the section on
-events (XXX).
+events (TDB).
 
 Our application object will have a single index page that displays the
 list of items in the container. You can click an item in the list to
@@ -1475,7 +1475,7 @@
 .. include:: groktut/containers/src/sample/app_templates/entryindex.pt
   :literal:
 
-Restart Zope and try this application.  Call your application
+Restart the server and try this application.  Call your application
 ``test``. Pay special attention to the URLs.
 
 First, we have the index page of our application:



More information about the checkins mailing list