[Checkins] SVN: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/ Initial import.
Timo Stollenwerk
timo at zmag.de
Mon Oct 19 08:02:36 EDT 2009
Log message for revision 105138:
Initial import.
Changed:
_U grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/bootstrap.py
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/buildout.cfg
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/README.txt
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/debug.ini.in
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/deploy.ini.in
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/site.zcml.in
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/zdaemon.conf.in
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/zope.conf.in
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/setup.py
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/__init__.py
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app.py
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app.txt
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app_templates/
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app_templates/index.pt
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/browser.py
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/configure.zcml
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/contact.py
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/ftesting.zcml
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/interfaces.py
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/static/
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/static/README.txt
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/tests.py
A grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/versions.cfg
-=-
Property changes on: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform
___________________________________________________________________
Added: svn:ignore
+ bin
develop-eggs
parts
var
.installed.cfg
.mr.developer.cfg
.project
.pydevproject
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/bootstrap.py
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/bootstrap.py (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/bootstrap.py 2009-10-19 12:02:35 UTC (rev 105138)
@@ -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: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/buildout.cfg
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/buildout.cfg (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/buildout.cfg 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,123 @@
+[buildout]
+develop = .
+parts =
+ eggbasket
+ app
+ i18n
+ test
+ mkdirs
+ zpasswd
+ zope_conf
+ site_zcml
+ zdaemon_conf
+ deploy_ini
+ debug_ini
+# For backward compatibility, telling buildout not to throw away
+# the data and log subdirectories from the parts directory.
+ data
+ log
+newest = false
+
+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
+
+extensions += mr.developer
+auto-checkout =
+ megrok.z3cform.base
+ megrok.z3cform.layout
+
+[versions]
+z3c.pagelet = 1.0.3
+
+[sources]
+megrok.z3cform.base = svn http://svn.zope.org/repos/main/megrok.z3cform.base/trunk
+megrok.z3cform.layout = svn http://svn.zope.org/repos/main/megrok.z3cform.layout/trunk
+
+
+[app]
+recipe = zc.recipe.egg
+eggs = tutorialmegrokz3cform
+ z3c.evalexception>=2.0
+ Paste
+ PasteScript
+ PasteDeploy
+interpreter = python-console
+
+[mkdirs]
+recipe = z3c.recipe.mkdir
+paths =
+ ${zope_conf:filestorage}
+ ${zope_conf:logfiles}
+ ${zope_conf:blobstorage}
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = tutorialmegrokz3cform
+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 = tutorialmegrokz3cform
+eggs = tutorialmegrokz3cform
+domain = tutorialmegrokz3cform
+output = src/tutorialmegrokz3cform/locales
+zcml =
+
+# This section is named so that the zpasswd utility is
+# called `zpasswd`
+[zpasswd]
+recipe = z3c.recipe.dev:script
+eggs = tutorialmegrokz3cform
+module = zope.app.server.zpasswd
+method = main
+
+[zope_conf]
+recipe = collective.recipe.template
+input = etc/zope.conf.in
+output = ${buildout:parts-directory}/etc/zope.conf
+filestorage = ${buildout:directory}/var/filestorage
+blobstorage = ${buildout:directory}/var/blobstorage
+logfiles = ${buildout:directory}/var/log
+extra =
+# 'extra' is copied verbatim. Use it for product config sections and so.
+
+# The [data] and [log] parts are still in here to instruct buildout to not
+# unintentionally throw away the parts/data and parts/log subdirectories
+# that contain the Data.fs and the log files. These files should be
+# copied to the new locations. See the upgrade notes for more information.
+[data]
+recipe = zc.recipe.filestorage
+
+[log]
+recipe = zc.recipe.filestorage
+
+[site_zcml]
+recipe = collective.recipe.template
+input = etc/site.zcml.in
+output = ${buildout:parts-directory}/etc/site.zcml
+
+[zdaemon_conf]
+recipe = collective.recipe.template
+input = etc/zdaemon.conf.in
+output = ${buildout:parts-directory}/etc/zdaemon.conf
+
+[deploy_ini]
+recipe = collective.recipe.template
+input = etc/deploy.ini.in
+output = ${buildout:parts-directory}/etc/deploy.ini
+
+[debug_ini]
+recipe = collective.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.0b2.tgz
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/README.txt
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/README.txt (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/README.txt 2009-10-19 12:02:35 UTC (rev 105138)
@@ -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: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/debug.ini.in
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/debug.ini.in (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/debug.ini.in 2009-10-19 12:02:35 UTC (rev 105138)
@@ -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'${zope_conf:logfiles}', '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:tutorialmegrokz3cform
+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: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/deploy.ini.in
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/deploy.ini.in (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/deploy.ini.in 2009-10-19 12:02:35 UTC (rev 105138)
@@ -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'${zope_conf:logfiles}', '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:tutorialmegrokz3cform
+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: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/site.zcml.in
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/site.zcml.in (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/site.zcml.in 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="tutorialmegrokz3cform">
+
+ <include package="tutorialmegrokz3cform" />
+
+ <configure i18n_domain="tutorialmegrokz3cform">
+
+ <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="admin"
+ password_manager="SHA1"
+ password="6bea56a0d033e22ae348aeb5660fc2140aec35850c4da997"
+ />
+
+ <!-- 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: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/zdaemon.conf.in
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/zdaemon.conf.in (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/zdaemon.conf.in 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,8 @@
+<runner>
+ program bin/paster serve ${buildout:directory}/parts/etc/deploy.ini
+ daemon on
+ transcript ${zope_conf:logfiles}/zdaemon.log
+ socket-name ${zope_conf:logfiles}/zdaemonsock
+ # Enable this to run the child process as a different user
+ # user zope
+</runner>
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/zope.conf.in
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/zope.conf.in (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/etc/zope.conf.in 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,55 @@
+# Identify the component configuration used to define the site:
+site-definition ${site_zcml:output}
+
+<zodb>
+ # Standard blob storage
+ <blobstorage>
+ blob-dir ${zope_conf:blobstorage}
+ <filestorage>
+ path ${zope_conf:filestorage}/Data.fs
+ </filestorage>
+ </blobstorage>
+
+# Uncomment this if you want a blob-less standard file storage instead:
+# <filestorage>
+# path ${zope_conf:filestorage}
+# </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 ${zope_conf:logfiles}/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
+
+# Extra configuration lines can be added to zope_conf's extra option. Put for
+# instance productconf sections in here.
+${zope_conf:extra}
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/setup.py
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/setup.py (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/setup.py 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,36 @@
+from setuptools import setup, find_packages
+
+version = '0.0'
+
+setup(name='tutorialmegrokz3cform',
+ 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
+ 'megrok.layout',
+ ],
+ entry_points = """
+ [console_scripts]
+ tutorialmegrokz3cform-debug = grokcore.startup:interactive_debug_prompt
+ tutorialmegrokz3cform-ctl = grokcore.startup:zdaemon_controller
+ [paste.app_factory]
+ main = grokcore.startup:application_factory
+ """,
+ )
Property changes on: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src
___________________________________________________________________
Added: svn:ignore
+ *.egg-info
megrok.z3cform.base
megrok.z3cform.layout
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/__init__.py
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/__init__.py (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/__init__.py 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1 @@
+# this directory is a package
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app.py
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app.py (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app.py 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,7 @@
+import grok
+
+class Tutorialmegrokz3cform(grok.Application, grok.Container):
+ pass
+
+class Index(grok.View):
+ pass # see app_templates/index.pt
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app.txt
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app.txt (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app.txt 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,32 @@
+Do a functional doctest test on the app.
+========================================
+
+:Test-Layer: functional
+
+Let's first create an instance of Tutorialmegrokz3cform at the top level:
+
+ >>> from tutorialmegrokz3cform.app import Tutorialmegrokz3cform
+ >>> root = getRootFolder()
+ >>> root['app'] = Tutorialmegrokz3cform()
+
+
+Run tests in the testbrowser
+----------------------------
+
+The zope.testbrowser.browser module exposes a Browser class that
+simulates a web browser similar to Mozilla Firefox or IE. We use that
+to test how our application behaves in a browser. For more
+information, see http://pypi.python.org/pypi/zope.testbrowser.
+
+Create a browser and visit the instance you just created:
+
+ >>> from zope.testbrowser.testing import Browser
+ >>> browser = Browser()
+ >>> browser.open('http://localhost/app')
+
+Check some basic information about the page you visit:
+
+ >>> browser.url
+ 'http://localhost/app'
+ >>> browser.headers.get('Status').upper()
+ '200 OK'
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app_templates/index.pt
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app_templates/index.pt (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/app_templates/index.pt 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,11 @@
+<html>
+<head>
+</head>
+<body>
+ <h1>Congratulations!</h1>
+
+ <p>Your Grok application is up and running.
+ Edit <code>tutorialmegrokz3cform/app_templates/index.pt</code> to change
+ this page.</p>
+</body>
+</html>
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/browser.py
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/browser.py (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/browser.py 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,60 @@
+import grok
+import megrok.z3cform.base
+
+#
+import contact
+import interfaces
+import datetime
+
+#
+from z3c.form import field, form, button, widget
+from examplemegrokz3cform.app import Examplemegrokz3cform
+from grokcore.component import global_adapter
+from z3c.form.interfaces import IAddForm
+
+
+class ContactAddForm(megrok.z3cform.base.PageAddForm):
+ """ A sample add form."""
+ grok.context(Examplemegrokz3cform)
+
+ label = u'Contact Add Form'
+ fields = field.Fields(interfaces.IContact)
+
+ def create(self, data):
+ return contact.Contact(**data)
+
+ def add(self, object):
+ count = 0
+ while 'contact-%i' %count in self.context:
+ count += 1;
+ self._name = 'contact-%i' %count
+ self.context[self._name] = object
+ return object
+
+ def nextURL(self):
+ return self.redirect(self.url(self.context[self._name]))
+
+
+class ContactEditForm(megrok.z3cform.base.PageEditForm):
+ grok.context(contact.Contact)
+ grok.name('edit.html')
+ form.extends(form.EditForm)
+ label = u'Contact Edit Form'
+ fields = field.Fields(interfaces.IContact)
+
+ @button.buttonAndHandler(u'Apply and View', name='applyView')
+ def handleApplyView(self, action):
+ self.handleApply(self, action)
+ if not self.widgets.errors:
+ self.redirect(self.url(self.context, name='index'))
+
+
+class ContactDisplayForm(megrok.z3cform.base.PageDisplayForm):
+ """ A simple Display Form"""
+ grok.context(contact.Contact)
+ grok.name('index')
+ template = grok.PageTemplateFile('display.pt')
+
+ fields = field.Fields(interfaces.IContact)
+
+
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/configure.zcml
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/configure.zcml (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/configure.zcml 2009-10-19 12:02:35 UTC (rev 105138)
@@ -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: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/contact.py
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/contact.py (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/contact.py 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,15 @@
+import grok
+import persistent
+import zope.interface
+from zope.schema import fieldproperty
+from examplemegrokz3cform import interfaces
+
+class Contact(grok.Model):
+ grok.implements(interfaces.IContact)
+
+ name = fieldproperty.FieldProperty(interfaces.IContact['name'])
+ description = fieldproperty.FieldProperty(interfaces.IContact['description'])
+
+ def __init__(self, name, description):
+ self.name = name
+ self.description = description
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/ftesting.zcml
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/ftesting.zcml (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/ftesting.zcml 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,34 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="tutorialmegrokz3cform"
+ package="tutorialmegrokz3cform"
+ >
+
+ <include package="tutorialmegrokz3cform" />
+
+ <!-- Typical functional testing security setup -->
+ <securityPolicy
+ component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+ />
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User"
+ />
+ <grant
+ permission="zope.View"
+ principal="zope.anybody"
+ />
+
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw"
+ />
+
+ <role id="zope.Manager" title="Site Manager" />
+ <grantAll role="zope.Manager" />
+ <grant role="zope.Manager" principal="zope.mgr" />
+
+</configure>
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/interfaces.py
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/interfaces.py (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/interfaces.py 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,16 @@
+import os
+import zope.interface
+import zope.schema
+
+class IContact(zope.interface.Interface):
+ """A z3c.form contact form."""
+
+ name = zope.schema.TextLine(
+ title=u'Name',
+ description=u'Name of the person.',
+ required=True)
+
+ description = zope.schema.TextLine(
+ title=u'Description',
+ description=u'Description of the person',
+ required=True)
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/static/README.txt
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/static/README.txt (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/static/README.txt 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,2 @@
+Put static files here, like javascript and css. They will be
+available as static/<filename> in views.
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/tests.py
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/tests.py (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/src/tutorialmegrokz3cform/tests.py 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,12 @@
+import os.path
+import z3c.testsetup
+import tutorialmegrokz3cform
+from zope.app.testing.functional import ZCMLLayer
+
+
+ftesting_zcml = os.path.join(
+ os.path.dirname(tutorialmegrokz3cform.__file__), 'ftesting.zcml')
+FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
+ allow_teardown=True)
+
+test_suite = z3c.testsetup.register_all_tests('tutorialmegrokz3cform')
Added: grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/versions.cfg
===================================================================
--- grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/versions.cfg (rev 0)
+++ grokapps/tutorialmegrokz3cform/trunk/tutorialmegrokz3cform/versions.cfg 2009-10-19 12:02:35 UTC (rev 105138)
@@ -0,0 +1,137 @@
+# 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.0b2.cfg
+# when this project was created.
+
+[versions]
+grok = 1.0b2
+ClientForm = 0.2.9
+grokcore.component = 1.7
+grokcore.formlib = 1.4
+grokcore.security = 1.2
+grokcore.view = 1.12.2
+grokcore.viewlet = 1.3
+grokui.admin = 0.3.2
+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
+grokcore.startup = 0.2
+setuptools = 0.6c9
+collective.recipe.template = 1.4.0
+z3c.evalexception = 2.0
+z3c.recipe.dev = 0.5.3
+z3c.recipe.i18n = 0.5.3
+z3c.recipe.mkdir = 0.3.1
+zc.buildout = 1.1.1
+zc.lockfile = 1.0.0
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+
+
More information about the checkins
mailing list