[Checkins] SVN: grok/trunk/doc/groktut/ Some more updates to the documentation - some tutorials weren't in

Martijn Faassen faassen at startifact.com
Tue Sep 15 05:15:54 EDT 2009


Log message for revision 104019:
  Some more updates to the documentation - some tutorials weren't in 
  the new world yet, I found.
  

Changed:
  U   grok/trunk/doc/groktut/an_empty_grok_project/buildout.cfg
  A   grok/trunk/doc/groktut/reading_url_parameters2/bootstrap.py
  U   grok/trunk/doc/groktut/reading_url_parameters2/buildout.cfg
  A   grok/trunk/doc/groktut/reading_url_parameters2/etc/
  A   grok/trunk/doc/groktut/reading_url_parameters2/etc/README.txt
  A   grok/trunk/doc/groktut/reading_url_parameters2/etc/debug.ini.in
  A   grok/trunk/doc/groktut/reading_url_parameters2/etc/deploy.ini.in
  A   grok/trunk/doc/groktut/reading_url_parameters2/etc/site.zcml.in
  A   grok/trunk/doc/groktut/reading_url_parameters2/etc/zdaemon.conf.in
  A   grok/trunk/doc/groktut/reading_url_parameters2/etc/zope.conf.in
  U   grok/trunk/doc/groktut/reading_url_parameters2/setup.py
  U   grok/trunk/doc/groktut/reading_url_parameters2/src/sample/configure.zcml
  A   grok/trunk/doc/groktut/reading_url_parameters2/versions.cfg

-=-
Modified: grok/trunk/doc/groktut/an_empty_grok_project/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/an_empty_grok_project/buildout.cfg	2009-09-15 09:14:35 UTC (rev 104018)
+++ grok/trunk/doc/groktut/an_empty_grok_project/buildout.cfg	2009-09-15 09:15:54 UTC (rev 104019)
@@ -1,6 +1,6 @@
 [buildout]
 develop = .
-parts = app i18n test data log zpasswd
+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/
@@ -73,7 +73,7 @@
 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
+[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_parameters2/bootstrap.py
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/bootstrap.py	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters2/bootstrap.py	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/buildout.cfg
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/buildout.cfg	2009-09-15 09:14:35 UTC (rev 104018)
+++ grok/trunk/doc/groktut/reading_url_parameters2/buildout.cfg	2009-09-15 09:15:54 UTC (rev 104019)
@@ -1,3 +1,79 @@
 [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_parameters2/etc/README.txt
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/etc/README.txt	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters2/etc/README.txt	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/etc/debug.ini.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/etc/debug.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters2/etc/debug.ini.in	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/etc/deploy.ini.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/etc/deploy.ini.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters2/etc/deploy.ini.in	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/etc/site.zcml.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/etc/site.zcml.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters2/etc/site.zcml.in	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/etc/zdaemon.conf.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/etc/zdaemon.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters2/etc/zdaemon.conf.in	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/etc/zope.conf.in
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/etc/zope.conf.in	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters2/etc/zope.conf.in	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/setup.py
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/setup.py	2009-09-15 09:14:35 UTC (rev 104018)
+++ grok/trunk/doc/groktut/reading_url_parameters2/setup.py	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/src/sample/configure.zcml
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/src/sample/configure.zcml	2009-09-15 09:14:35 UTC (rev 104018)
+++ grok/trunk/doc/groktut/reading_url_parameters2/src/sample/configure.zcml	2009-09-15 09:15:54 UTC (rev 104019)
@@ -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_parameters2/versions.cfg
===================================================================
--- grok/trunk/doc/groktut/reading_url_parameters2/versions.cfg	                        (rev 0)
+++ grok/trunk/doc/groktut/reading_url_parameters2/versions.cfg	2009-09-15 09:15:54 UTC (rev 104019)
@@ -0,0 +1,126 @@
+[versions]
+grok = 1.0b1
+ClientForm = 0.2.9
+grokcore.component = 1.7
+grokcore.formlib = 1.2
+grokcore.security = 1.2
+grokcore.view = 1.11
+grokcore.viewlet = 1.1
+grokui.admin = 0.4.0
+martian = 0.11
+mechanize = 0.1.7b
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.recipe.eggbasket = 0.4.3
+z3c.testsetup = 0.4
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.3
+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.2
+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.9
+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.7.6
+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.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



More information about the checkins mailing list