[Checkins] SVN: grok/branches/ulif-i18n/ Merged last changes of
trunk into i18n-branch.
Uli Fouquet
uli at gnufix.de
Wed Oct 17 18:22:37 EDT 2007
Log message for revision 80908:
Merged last changes of trunk into i18n-branch.
Changed:
U grok/branches/ulif-i18n/CHANGES.txt
U grok/branches/ulif-i18n/CREDITS.txt
U grok/branches/ulif-i18n/buildout.cfg
U grok/branches/ulif-i18n/doc/grok2html.py
U grok/branches/ulif-i18n/doc/index.txt
U grok/branches/ulif-i18n/doc/minitutorials/index.txt
U grok/branches/ulif-i18n/doc/reference/README.txt
A grok/branches/ulif-i18n/doc/reference/components.rst
D grok/branches/ulif-i18n/doc/reference/components.tex
A grok/branches/ulif-i18n/doc/reference/contents.rst
A grok/branches/ulif-i18n/doc/reference/core.rst
D grok/branches/ulif-i18n/doc/reference/core.tex
A grok/branches/ulif-i18n/doc/reference/decorators.rst
D grok/branches/ulif-i18n/doc/reference/decorators.tex
A grok/branches/ulif-i18n/doc/reference/directives.rst
D grok/branches/ulif-i18n/doc/reference/directives.tex
A grok/branches/ulif-i18n/doc/reference/events.rst
D grok/branches/ulif-i18n/doc/reference/events.tex
A grok/branches/ulif-i18n/doc/reference/exceptions.rst
D grok/branches/ulif-i18n/doc/reference/exceptions.tex
A grok/branches/ulif-i18n/doc/reference/functions.rst
D grok/branches/ulif-i18n/doc/reference/functions.tex
A grok/branches/ulif-i18n/doc/reference/index.rst
A grok/branches/ulif-i18n/doc/reference/model.rst
D grok/branches/ulif-i18n/doc/reference/model.tex
D grok/branches/ulif-i18n/doc/reference/reference.tex
U grok/branches/ulif-i18n/setup.py
U grok/branches/ulif-i18n/src/grok/__init__.py
U grok/branches/ulif-i18n/src/grok/_grok.py
U grok/branches/ulif-i18n/src/grok/admin/docgrok.py
U grok/branches/ulif-i18n/src/grok/admin/objectinfo.py
U grok/branches/ulif-i18n/src/grok/components.py
U grok/branches/ulif-i18n/src/grok/configure.zcml
U grok/branches/ulif-i18n/src/grok/directive.py
U grok/branches/ulif-i18n/src/grok/formlib.py
U grok/branches/ulif-i18n/src/grok/ftests/form/actions.py
U grok/branches/ulif-i18n/src/grok/ftests/form/addform.py
D grok/branches/ulif-i18n/src/grok/ftests/form/editform_applydata_classfields.py
A grok/branches/ulif-i18n/src/grok/ftests/form/editform_applydata_schemafields.py
U grok/branches/ulif-i18n/src/grok/ftests/form/form.py
U grok/branches/ulif-i18n/src/grok/ftests/form/update.py
A grok/branches/ulif-i18n/src/grok/ftests/view/layers.py
U grok/branches/ulif-i18n/src/grok/interfaces.py
U grok/branches/ulif-i18n/src/grok/meta.py
U grok/branches/ulif-i18n/src/grok/tests/event/subscriber.py
U grok/branches/ulif-i18n/src/grok/tests/form/form.py
U grok/branches/ulif-i18n/src/grok/tests/form/schemaform.py
A grok/branches/ulif-i18n/versions.cfg
-=-
Modified: grok/branches/ulif-i18n/CHANGES.txt
===================================================================
--- grok/branches/ulif-i18n/CHANGES.txt 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/CHANGES.txt 2007-10-17 22:22:36 UTC (rev 80908)
@@ -7,6 +7,8 @@
Feature changes
---------------
+* Integrated skins and layers. grok.layer, grok.IGrokLayer, grok.Skin
+
* Removed grok.define_permission in favor of the grok.Permission
component base class
@@ -16,6 +18,10 @@
* Add grok.localesdir directive.
+* Removed support for defining model schemas using an inner class with the
+ special name 'fields'. This was abandoned in favor the usual Zope 3 way of
+ defining schemas in interfaces and implementing them in our Grok models.
+
Bug fixes
---------
@@ -23,6 +29,12 @@
* `handle...` is not a special function name any more.
+* Views no longer need a custom AbsoluteURL to determine their URL,
+ since each instance now properly gets a __name__ attribute.
+
+* buildout.cfg extends versions.cfg to pin down the versions of the
+ dependency tree.
+
Restructuring
-------------
@@ -54,7 +66,7 @@
Bug fixes
---------
-
+
* A fix in Martian where multiple grok.Model or grok.Container classes
could result in something being found as a context twice.
Modified: grok/branches/ulif-i18n/CREDITS.txt
===================================================================
--- grok/branches/ulif-i18n/CREDITS.txt 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/CREDITS.txt 2007-10-17 22:22:36 UTC (rev 80908)
@@ -27,6 +27,10 @@
* Wim Boucqaert (admin interface layout improvements)
+* Kevin M. Smith (skins and layers support)
+
+* Luciano Ramalho
+
* ME GROK (team mascot)
Thank you
Modified: grok/branches/ulif-i18n/buildout.cfg
===================================================================
--- grok/branches/ulif-i18n/buildout.cfg 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/buildout.cfg 2007-10-17 22:22:36 UTC (rev 80908)
@@ -2,12 +2,9 @@
develop = . doc grokwiki
parts = docs grokwiki zopectl data test
find-links = http://download.zope.org/distribution/
-index = http://download.zope.org/ppix
-versions = release-0.10
+extends = versions.cfg
+versions = versions
-[release-0.10]
-ZODB3 = 3.8.0b2
-
[docs]
recipe = zc.recipe.egg
eggs = grokdocs
@@ -57,5 +54,5 @@
[test]
recipe = zc.recipe.testrunner
-eggs = grok
+eggs = grok
defaults = ['--tests-pattern', '^f?tests$', '-v']
Modified: grok/branches/ulif-i18n/doc/grok2html.py
===================================================================
--- grok/branches/ulif-i18n/doc/grok2html.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/grok2html.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -35,6 +35,7 @@
self.content,
writer=writer,
settings_overrides=settings_overrides,)
+ html = codecs.decode(html, 'utf_8')
return html
class RestFile(object):
@@ -181,6 +182,9 @@
rest_files.append(RestFile('permissions',
os.path.join(source_dir, 'minitutorials', 'permissions.txt'),
os.path.join(www_dir, 'minitutorials', 'permissions.html')))
+ rest_files.append(RestFile('transient-objects',
+ os.path.join(source_dir, 'minitutorials', 'transient-objects.txt'),
+ os.path.join(www_dir, 'minitutorials', 'transient-objects.html')))
rest_files.append(RestFile('zc.buildout',
'http://svn.zope.org/*checkout*/zc.buildout/trunk/doc/tutorial.txt',
os.path.join(www_dir, 'minitutorials', 'buildout.html')))
Modified: grok/branches/ulif-i18n/doc/index.txt
===================================================================
--- grok/branches/ulif-i18n/doc/index.txt 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/index.txt 2007-10-17 22:22:36 UTC (rev 80908)
@@ -25,7 +25,14 @@
.. _Zope 3: http://wiki.zope.org/zope3
+Grok News
+---------
+2007-09-24:
+ The first week of October (1-5 October) we are having the `Grok Neanderthal
+ Sprint <http://wiki.zope.org/grok/NeanderthalerSprint/>`_ in Cologne, Germany.
+ This sprint is generously sponsored by `GfU Cyrus <http://www.gfu.net/>`_.
+
Who is Grok?
------------
Modified: grok/branches/ulif-i18n/doc/minitutorials/index.txt
===================================================================
--- grok/branches/ulif-i18n/doc/minitutorials/index.txt 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/minitutorials/index.txt 2007-10-17 22:22:36 UTC (rev 80908)
@@ -8,6 +8,16 @@
These mini-tutorials have been contributed by members of the Grok community.
+* `Newbie Permissions Tutorial </minitutorials/permissions.html>`_:
+
+ Zope3 and Grok come with authorization capabilities out of the box. While a
+ vanilla Zope3 application protects all content by default and performs
+ authorization checks on the content objects themselves, Grok allows access to
+ everything unless you explicitly restrict it. The authorization checks here are
+ done based on the Views used to access (display/manipulate) the content.
+
+ Author: Luis De la Parra; Uli Fouquet; Jan-Wijbrand Kolman
+
* `Newbie Search Tutorial </minitutorials/searching.html>`_:
Grok supports the vanilla indexing services available in Zope 3
@@ -34,6 +44,15 @@
Author: Kushal Das
+* `Navigating To Transient Objects Tutorial </minitutorials/transient-objects.html>`_:
+
+ Sometimes you need to create objects that do not persist in the ZODB.
+ For the purpose of this tutorial, we are going to call all such objects
+ transient objects. This highlights the fact that, from the point of view of
+ Grok, they are going to be instantiated on-the-fly as a user visits them.
+
+ Author: Brandon Craig Rhodes
+
Buildout
========
Modified: grok/branches/ulif-i18n/doc/reference/README.txt
===================================================================
--- grok/branches/ulif-i18n/doc/reference/README.txt 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/README.txt 2007-10-17 22:22:36 UTC (rev 80908)
@@ -2,42 +2,37 @@
The grok reference manual
=========================
-The manual is written using LaTeX with support for the Python documentation
-markup. The tex sources can be compiled to HTML and PDF. To build the manual,
-you need the 'mkhowto' script from a recent Python source distribution.
+NOTE: The Grok reference manual is in the process of being migrated to a
+RestructuredText infrastructure.
-Build the HTML
---------------
+How to build HTML documentation from ReST files
+-----------------------------------------------
-Compiling the sources into HTML::
+The toolchain to generate HTML from the ReST files in this directory
+is currently also under construction.
- $ mkhowto --html reference.tex
+A current snapshot of the toolchain can be retrieved from the
+jasper-docgroktools branch of the grok svn repository.
-The directory 'reference/' keeps all files required to display the manual after
-that call and can be put on a static webserver.
+ $ svn co http://svn.zope.org/grok/branches/jasper-grokdoctool \
+ grokdoctool
-Build the PDF
--------------
+Then change into the checked out directory::
-The file 'reference.pdf' will contain the PDF version of the manual after this
-call::
+ $ cd grokdoctool
- $ mkhowto --pdf reference.tex
+and follow the advices given in README.txt.
-Installing prerequisites on Debian and Ubuntu systems
------------------------------------------------------
+Note, that you need development files for libxml2 and libxslt to
+install lxml correctly. Debian/Ubuntu users can get the correct files,
+using
-On recent Debian and Ubuntu systems, the following packages provide the
-required toolset for compiling the sources.
+ $ apt-get install libxml2-dev libxslt-dev
-The basic LaTeX infrastructure::
+After generating the grokdoctool, you can run it with the source
+directory of the restructured text files as argument:
- $ sudo apt-get install tetex-base tetex-bin tetex-extra latex2html
+ $ bin/grokdoctool <path-to-the-rest-files-dir>
-The python-dev package provides the mkhowto script::
-
- $ sudo apt-get install python2.4-dev
-
-This script will be located in::
-
- /usr/lib/python2.4/doc/tools/mkhowto
+This procedure is subject to changes. The format of the reference
+documentation (ReST) is not.
Copied: grok/branches/ulif-i18n/doc/reference/components.rst (from rev 80896, grok/trunk/doc/reference/components.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/components.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/components.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,316 @@
+
+**********
+Components
+**********
+
+.. Here we documented the component base classes. For the directive possible
+ for each component we document only the specific within its context. We then
+ refer to the directives documented in the directives.rst file.
+
+The :mod:`grok` module defines a set of components that provide basic Zope 3
+functionality in a convenient way. Grok applications are built by subclassing
+these components.
+
+Core components
+~~~~~~~~~~~~~~~
+
+:class:`grok.Model`
+===================
+
+Base class to define an application "content" or model object. Model objects
+provide persistence and containment.
+
+:class:`grok.Container`
+=======================
+
+Mixin base class to define a container object. The container implements the
+zope.app.container.interfaces.IContainer interface using a BTree, providing
+reasonable performance for large collections of objects.
+
+:class:`grok.Application`
+=========================
+
+Adapters
+~~~~~~~~
+
+:class:`grok.Adapter`
+=====================
+
+Implementation, configuration, and registration of Zope 3 adapters.
+
+.. class:: grok.Adapter
+
+ Base class to define an adapter. Adapters are automatically registered when a
+ module is "grokked".
+
+ .. attribute:: grok.Adapter.context
+
+ The adapted object.
+
+ **Directives:**
+
+ :func:`grok.context(context_obj_or_interface)`
+ Maybe required. Identifies the type of objects or interface for the adaptation.
+
+ .. seealso::
+
+ :function:`grok.context`
+
+ :func:`grok.implements(\*interfaces)`
+ Required. Identifies the interface(s) the adapter implements.
+
+ .. seealso::
+
+ :function:`grok.implements`
+
+ :func:`grok.name(name)`
+ Optional. Identifies the name used for the adapter registration. If ommitted, no
+ name will be used.
+
+ When a name is used for the adapter registration, the adapter can only be
+ retrieved by explicitely using its name.
+
+ .. seealso::
+
+ :function:`grok.name`
+
+ :func:`grok.provides(name)`
+ Maybe required.
+
+ .. seealso::
+
+ :function:`grok.provides`
+
+**Example 1:** ::
+
+ import grok
+ from zope import interface
+
+ class Cave(grok.Model):
+ pass
+
+ class IHome(interface.Interface):
+ pass
+
+ class Home(grok.Adapter):
+ grok.implements(IHome)
+
+ home = IHome(cave)
+
+**Example 2: Register and retrieve the adapter under a specific name** ::
+
+ import grok
+ from zope import interface
+
+ class Cave(grok.Model):
+ pass
+
+ class IHome(interface.Interface):
+ pass
+
+ class Home(grok.Adapter):
+ grok.implements(IHome)
+ grok.name('home')
+
+ from zope.component import getAdapter
+ home = getAdapter(cave, IHome, name='home')
+
+:class:`grok.MultiAdapter`
+==========================
+
+.. class:: grok.MultiAdapter
+
+ Base class to define a multi adapter. MultiAdapters are automatically
+ registered when a module is "grokked".
+
+ **Directives:**
+
+ :func:`grok.adapts(\*objects_or_interfaces)`
+ Required. Identifies the combination of types of objects or interfaces
+ for the adaptation.
+
+ :func:`grok.implements(\*interfaces)`
+ Required. Identifies the interfaces(s) the adapter implements.
+
+ :func:`grok.name(name)`
+ Optional. Identifies the name used for the adapter registration. If
+ ommitted, no name will be used.
+
+ When a name is used for the adapter registration, the adapter can only be
+ retrieved by explicitely using its name.
+
+ :func:`grok.provides(name)`
+ Maybe required. If the adapter implements more than one interface,
+ :func:`grok.provides` is required to disambiguate for what interface the
+ adapter will be registered.
+
+**Example:** ::
+
+ import grok
+ from zope import interface
+
+ class Fireplace(grok.Model):
+ pass
+
+ class Cave(grok.Model):
+ pass
+
+ class IHome(interface.Interface):
+ pass
+
+ class Home(grok.MultiAdapter):
+ grok.adapts(Cave, Fireplace)
+ grok.implements(IHome)
+
+ def __init__(self, cave, fireplace):
+ self.cave = cave
+ self.fireplace = fireplace
+
+ home = IHome(cave, fireplace)
+
+:class:`grok.Annotation`
+========================
+
+Utilities
+~~~~~~~~~
+
+:class:`grok.GlobalUtility`
+===========================
+
+.. class:: grok.GlobalUtility
+
+ Base class to define a globally registered utility. Global utilities are
+ automatically registered when a module is "grokked".
+
+ **Directives:**
+
+ :func:`grok.implements(\*interfaces)`
+ Required. Identifies the interfaces(s) the utility implements.
+
+ :func:`grok.name(name)`
+ Optional. Identifies the name used for the adapter registration. If
+ ommitted, no name will be used.
+
+ When a name is used for the global utility registration, the global
+ utility can only be retrieved by explicitely using its name.
+
+ :func:`grok.provides(name)`
+ Maybe required. If the global utility implements more than one interface,
+ :func:`grok.provides` is required to disambiguate for what interface the
+ global utility will be registered.
+
+:class:`grok.LocalUtility`
+==========================
+
+.. class:: grok.LocalUtility
+
+ Base class to define a utility that will be registered local to a
+ :class:`grok.Site` or :class:`grok.Application` object by using the
+ :func:`grok.local_utility` directive.
+
+ **Directives:**
+
+ :func:`grok.implements(\*interfaces)`
+ Optional. Identifies the interfaces(s) the utility implements.
+
+ :func:`grok.name(name)`
+ Optional. Identifies the name used for the adapter registration. If
+ ommitted, no name will be used.
+
+ When a name is used for the local utility registration, the local utility
+ can only be retrieved by explicitely using its name.
+
+ :func:`grok.provides(name)`
+ Maybe required. If the local utility implements more than one interface
+ or if the implemented interface cannot be determined,
+ :func:`grok.provides` is required to disambiguate for what interface the
+ local utility will be registered.
+
+ .. seealso::
+
+ Local utilities need to be registered in the context of :class:`grok.Site`
+ or :class:`grok.Application` using the :func:`grok.local_utility` directive.
+
+:class:`grok.Site`
+==================
+
+Views
+~~~~~
+
+:class:`grok.View`
+==================
+
+:class:`grok.JSON
+==================
+
+:class:`grok.XMLRPC`
+====================
+
+:class:`grok.Traverser`
+=======================
+
+:class:`grok.PageTemplate`
+==========================
+
+:class:`grok.PageTemplateFile`
+==============================
+
+Forms
+~~~~~
+
+:class:`grok.Form`
+==================
+
+.. Do not forget about the form_fields class attribute!
+
+:class:`grok.AddForm`
+=====================
+
+:class:`grok.EditForm`
+======================
+
+:class:`grok.DisplayForm`
+=========================
+
+Security
+~~~~~~~~
+
+:class:`Permission`
+===================
+
+:func:`grok.define_permission` -- define a permission
+=====================================================
+
+.. function:: grok.define_permission(name)
+
+ A module-level directive to define a permission with name
+ `name`. Usually permission names are prefixed by a component- or
+ application name and a dot to keep them unique.
+
+ Because in Grok by default everything is accessible by everybody,
+ it is important to define permissions, which restrict access to
+ certain principals or roles.
+
+ **Example:** ::
+
+ import grok
+ grok.define_permission('cave.enter')
+
+
+ .. seealso::
+
+ :func:`grok.require`, :class:`grok.Permission`, :class:`grok.Role`
+
+ .. versionchanged:: 0.11
+ replaced by :class:`grok.Permission`.
+
+:class:`Role`
+=============
+
+Uncategorized
+~~~~~~~~~~~~~
+
+.. The weird classes we couldn' categorize yet
+
+:class:`grok.Indexes`
+=====================
Deleted: grok/branches/ulif-i18n/doc/reference/components.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/components.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/components.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,238 +0,0 @@
-\chapter{Components}
-
-The \module{grok} module defines a set of components that provide basic Zope 3
-functionality in a convenient way.
-
-\section{\class{grok.Adapter}}
-
- Implementation, configuration, and registration of Zope 3 adapters.
-
- \begin{classdesc*}{grok.Adapter}
- Base class to define an adapter. Adapters are automatically registered when
- a module is "grokked".
-
- \begin{memberdesc}{context}
- The adapted object.
- \end{memberdesc}
-
- \begin{bf}Directives:\end{bf}
-
- \begin{itemize}
- \item[\function{grok.context(context_obj_or_interface)}] Maybe required.
- Identifies the type of objects or interface for the adaptation.
-
- If Grok can determine a context for adaptation from the module, this
- directive can be omitted. If the automatically determined context is not
- correct, or if no context can be derived from the module the directive is
- required.
-
- \item[\function{grok.implements(*interfaces)}] Required. Identifies the
- interface(s) the adapter implements.
-
- \item[\function{grok.name(name)}] Optional. Identifies the name used for
- the adapter registration. If ommitted, no name will be used.
-
- When a name is used for the adapter registration, the adapter can only be
- retrieved by explicitely using its name.
-
- \item[\function{grok.provides(name)}] Maybe required. If the adapter
- implements more than one interface, \function{grok.provides} is required to
- disambiguate for what interface the adapter will be registered.
- \end{itemize}
- \end{classdesc*}
-
- \begin{bf}Example:\end{bf}
-
- \begin{verbatim}
-import grok
-from zope import interface
-
-class Cave(grok.Model):
- pass
-
-class IHome(interface.Interface):
- pass
-
-class Home(grok.Adapter):
- grok.implements(IHome)
-
-home = IHome(cave)
- \end{verbatim}
-
- \begin{bf}Example 2:\end{bf}
-
- \begin{verbatim}
-import grok
-from zope import interface
-
-class Cave(grok.Model):
- pass
-
-class IHome(interface.Interface):
- pass
-
-class Home(grok.Adapter):
- grok.implements(IHome)
- grok.name('home')
-
-from zope.component import getAdapter
-home = getAdapter(cave, IHome, name='home')
- \end{verbatim}
-
-\section{\class{grok.AddForm}}
-
-\section{\class{grok.Annotation}}
-
-\section{\class{grok.Application}}
-
-\section{grok.ClassGrokker}
-
-\section{\class{grok.Container}}
-
- \begin{classdesc*}{grok.Container}
- Mixin base class to define a container object. The container implements the
- zope.app.container.interfaces.IContainer interface using a BTree, providing
- reasonable performance for large collections of objects.
- \end{classdesc*}
-
-\section{\class{grok.DisplayForm}}
-
-\section{\class{grok.EditForm}}
-
-\section{\class{grok.Form}}
-
-\section{\class{grok.GlobalUtility}}
-
- \begin{classdesc*}{grok.GlobalUtility}
- Base class to define a globally registered utility. Global utilities are
- automatically registered when a module is "grokked".
-
- \begin{bf}Directives:\end{bf}
-
- \begin{itemize}
- \item[\function{grok.implements(*interfaces)}] Required. Identifies the
- interfaces(s) the utility implements.
-
- \item[\function{grok.name(name)}] Optional. Identifies the name used for
- the adapter registration. If ommitted, no name will be used.
-
- When a name is used for the global utility registration, the global utility
- can only be retrieved by explicitely using its name.
-
- \item[\function{grok.provides(name)}] Maybe required. If the global utility
- implements more than one interface, \function{grok.provides} is required to
- disambiguate for what interface the global utility will be registered.
- \end{itemize}
- \end{classdesc*}
-
-\section{\class{grok.Indexes}}
-
-\section{grok.InstanceGrokker}
-
-\section{\class{grok.JSON}}
-
-\section{\class{grok.LocalUtility}}
-
- \begin{classdesc*}{grok.LocalUtility}
- Base class to define a utility that will be registered local to a
- \class{grok.Site} or \class{grok.Application} object by using the
- \function{grok.local_utility} directive.
-
- \begin{bf}Directives:\end{bf}
-
- \begin{itemize}
- \item[\function{grok.implements(*interfaces)}] Optional. Identifies the
- interfaces(s) the utility implements.
-
- \item[\function{grok.name(name)}] Optional. Identifies the name used for
- the adapter registration. If ommitted, no name will be used.
-
- When a name is used for the local utility registration, the local utility
- can only be retrieved by explicitely using its name.
-
- \item[\function{grok.provides(name)}] Maybe required. If the local utility
- implements more than one interface or if the implemented interface cannot
- be determined, \function{grok.provides} is required to disambiguate for
- what interface the local utility will be registered.
- \end{itemize}
- \end{classdesc*}
-
- \begin{seealso}
- Local utilities need to be registered in the context of \class{grok.Site} or
- \class{grok.Application} using the \function{grok.local_utility} directive.
- \end{seealso}
-
-\section{\class{grok.Model}}
-
- Base class to define an application "content" or model object. Model objects
- provide persistence and containment.
-
-\section{grok.ModuleGrokker}
-
-\section{\class{grok.MultiAdapter}}
-
- \begin{classdesc*}{grok.MultiAdapter}
- Base class to define a multi adapter. MultiAdapters are automatically
- registered when a module is "grokked".
-
- \begin{bf}Directives:\end{bf}
-
- \begin{itemize}
- \item[\function{grok.adapts(*objects_or_interfaces)}] Required. Identifies
- the combination of types of objects or interfaces for the adaptation.
-
- \item[\function{grok.implements(*interfaces)}] Required. Identifies the
- interfaces(s) the adapter implements.
-
- \item[\function{grok.name(name)}] Optional. Identifies the name used for
- the adapter registration. If ommitted, no name will be used.
-
- When a name is used for the adapter registration, the adapter can only
- be retrieved by explicitely using its name.
-
- \item[\function{grok.provides(name)}] Maybe required. If the adapter
- implements more than one interface, \function{grok.provides} is required to
- disambiguate for what interface the adapter will be registered.
- \end{itemize}
- \end{classdesc*}
-
- \begin{bf}Example:\end{bf}
-
- \begin{verbatim}
-import grok
-from zope import interface
-
-class Fireplace(grok.Model):
- pass
-
-class Cave(grok.Model):
- pass
-
-class IHome(interface.Interface):
- pass
-
-class Home(grok.MultiAdapter):
- grok.adapts(Cave, Fireplace)
- grok.implements(IHome)
-
- def __init__(self, cave, fireplace):
- self.cave = cave
- self.fireplace = fireplace
-
-home = IHome(cave, fireplace)
- \end{verbatim}
-
-\section{grok.PageTemplate}
-
-\section{grok.PageTemplateFile}
-
-\section{\class{grok.Site}}
-
- Base class to define an site object. Site objects provide persistence and
- containment.
-
-\section{\class{grok.Traverser}}
-
-\section{\class{grok.View}}
-
-\section{\class{grok.XMLRPC}}
Copied: grok/branches/ulif-i18n/doc/reference/contents.rst (from rev 80896, grok/trunk/doc/reference/contents.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/contents.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/contents.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,18 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Grok Documentation contents
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+.. toctree::
+
+ core.rst
+ components.rst
+ directives.rst
+ decorators.rst
+ functions.rst
+ events.rst
+ exceptions.rst
+
+bugs.rst
+about.rst
+license.rst
+copyright.rst
Copied: grok/branches/ulif-i18n/doc/reference/core.rst (from rev 80896, grok/trunk/doc/reference/core.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/core.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/core.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,45 @@
+
+****
+Core
+****
+
+The :mod:`grok` module defines a few functions to interact with grok itself.
+
+
+:func:`grok.grok` -- Grok a package or module
+=============================================
+
+
+.. function:: grok(dotted_name)
+
+ Grokking a package or module activates the contained components (like models,
+ views, adapters, templates, etc.) and registers them with Zope 3's component
+ architecture.
+
+ The `dotted_name` must specify either a Python module or package that is
+ available from the current PYTHONPATH.
+
+ Grokking a module:
+
+#. Scan the module for known components: models, adapters, utilities, views,
+ traversers, templates and subscribers.
+
+#. Check whether a directory with file system templates exists
+ (:file:`<modulename>_templates`). If it exists, load the file system templates
+ into the template registry for this module.
+
+#. Determine the module context.
+
+#. Register all components with the Zope 3 component architecture.
+
+#. Initialize schemata for registered models
+
+ Grokking a package:
+
+#. Grok the package as a module.
+
+#. Check for a static resource directory (:file:`static`) and register it if it
+ exists.
+
+#. Recursively grok all sub-modules and sub-packages.
+
Deleted: grok/branches/ulif-i18n/doc/reference/core.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/core.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/core.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,50 +0,0 @@
-\chapter{Core}
-
-The \module{grok} module defines a few functions to interact with grok itself.
-
-
-\section{\function{grok.grok} -- Grok a package or module}
-
- \begin{funcdesc}{grok}{dotted_name}
-
- Grokking a package or module activates the contained components (like
- models, views, adapters, templates, etc.) and registers them with Zope 3's
- component architecture.
-
- The \var{dotted_name} must specify either a Python module or package
- that is available from the current PYTHONPATH.
-
- Grokking a module:
-
- \begin{enumerate}
-
- \item Scan the module for known components: models, adapters,
- utilities, views, traversers, templates and subscribers.
-
- \item Check whether a directory with file system templates
- exists (\file{<modulename>_templates}). If it exists,
- load the file system templates into the template
- registry for this module.
-
- \item Determine the module context.
-
- \item Register all components with the Zope 3 component architecture.
-
- \item Initialize schemata for registered models
-
- \end{enumerate}
-
- Grokking a package:
-
- \begin{enumerate}
- \item Grok the package as a module.
-
- \item Check for a static resource directory (\file{static})
- and register it if it exists.
-
- \item Recursively grok all sub-modules and sub-packages.
-
- \end{enumerate}
-
- \end{funcdesc}
-
Copied: grok/branches/ulif-i18n/doc/reference/decorators.rst (from rev 80896, grok/trunk/doc/reference/decorators.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/decorators.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/decorators.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,75 @@
+
+**********
+Decorators
+**********
+
+grok uses a few decorators to register functions or methods for specific
+functionality.
+
+
+:func:`grok.subscribe` -- Register a function as a subscriber for an event
+==========================================================================
+
+
+.. function:: subscribe(*classes_or_interfaces)
+
+Declare that the decorated function subscribes to an event or a combination of
+objects and events and register it.
+
+Applicable on module-level for functions. Requires at least one class or
+interface as argument.
+
+(Similar to Zope 3's :func:`subscriber` decorator, but automatically performs
+the registration of the component.)
+
+
+:func:`grok.action` -- Declare a form submit handler
+=====================================================
+
+
+:func:`grok.require` -- Protect a method with a permission
+===========================================================
+
+:func:`grok.adapter/grok.implementer` -- Declare an adapter factory
+====================================================================
+
+.. XXX these two decorators are always used together, but are named separately because they are separate in the Zope 3 API. Should grok implement this as one decorator with two arguments?
+
+These decorators are always used in tandem to declare an adapter factory.
+
+.. function:: grok.adapter(*interfaces)
+
+`*interfaces` -- the interfaces *adapted* by the object created by this factory.
+
+.. function:: grok.implementer(interface)
+
+`interface` -- the interface *provided* by the object created by this factory.
+
+
+**Example 1:** ::
+
+ @grok.adapter(ICave)
+ @grok.implementer(IHome)
+ def home_for_cave(cave):
+ return Home()
+
+**Example 2: adapt a regular class instead of an interface ** ::
+
+ @grok.adapter(Cave)
+ @grok.implementer(IHome)
+ def home_for_cave(cave):
+ return Home()
+
+**Example 3: declare a multi-adapter factory ** ::
+
+ @grok.adapter(ICave,IFire)
+ @grok.implementer(ICozy)
+ def cozy_dwelling(cave, fire):
+ return Dwelling()
+
+
+
+
+
+
+
Deleted: grok/branches/ulif-i18n/doc/reference/decorators.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/decorators.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/decorators.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,21 +0,0 @@
-\chapter{Decorators}
-
-grok uses a few decorators to register functions or methods for specific
-functionality.
-
- \section{\function{grok.subscribe} -- Register a function as a subscriber
- for an event}
-
- \begin{funcdesc}{subscribe}{*classes_or_interfaces}
-
- Declare that the decorated function subscribes to an event or a
- combination of objects and events and register it.
-
- Applicable on module-level for functions. Requires at least one class
- or interface as argument.
-
- (Similar to Zope 3's \function{subscriber} decorator, but automatically
- performs the registration of the component.)
- \end{funcdesc}
-
- \section{grok.action}
Copied: grok/branches/ulif-i18n/doc/reference/directives.rst (from rev 80896, grok/trunk/doc/reference/directives.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/directives.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/directives.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,483 @@
+
+**********
+Directives
+**********
+
+.. Here we document the generic behaviour of the module level and class level
+ directives. The context sensitive behaviour is described in the individual
+ component documentation. We do use specific example to illustrate the use
+ of the directives.
+
+The :mod:`grok` module defines a set of directives that allow you to configure
+and register your components. Most directives assume a default, based on the
+environment of a module. (For example, a view will be automatically associated
+with a model if the association can be made unambigously.)
+
+If no default can be assumed for a value, grok will explicitly tell you what is
+missing and how you can provide a default or explicit assignment for the value
+in question.
+
+Core directives
+~~~~~~~~~~~~~~~
+
+:func:`grok.context` -- Declare the context for views, adapters, etc.
+=====================================================================
+
+
+.. function:: grok.context(*class_or_interface)
+
+A class or module level directive to indicate the context for something
+(class or module) in the same scope. When used on module level, it will set
+the context for all views, adapters, etc. in that module. When used on class
+level, it will set the context for that particular class.
+
+With Grok contexts are set automatically for some objects, if they are
+unambigous. For example a :class:`grok.View` will get the only
+:class:`grok.Application` or :class:`grok.Model` class as context, iff there
+exists exactly one in the same module. If there are more possible contexts
+or you want to set a type (class/interface) from another module as context,
+than the one choosen by default, then you have to call :func:`grok.context`
+explicitly.
+
+**Example:**
+
+Here the :func:`grok.context` directive indicates, that
+:class:`Mammoth` instances will be the context of :class:`Index`
+views (and not instances of :class:`Cave`) ::
+
+ import grok
+
+ class Mammoth(grok.Model):
+ pass
+
+ class Cave(grok.Model):
+ pass
+
+ class Index(grok.View):
+ grok.context(Mammoth)
+
+.. seealso::
+
+ :class:`grok.View`, :class:`grok.Adapter`, :class:`grok.MultiAdapter`
+
+:func:`grok.name` -- associate a component with a name
+======================================================
+
+.. function:: grok.name(name)
+
+A class level directive used to associate a component with a single name
+`name`. Typically this directive is optional. The default behaviour when no
+name is given depends on the component. The same applies to the semantics of
+this directive: for what exactly a name is set when using this directive,
+depends on the component.
+
+**Example:** ::
+
+ import grok
+
+ class Mammoth(grok.Model):
+ pass
+
+ # a common use case is to have a URL for a view named differently than
+ # the name of the view class itself.
+ class SomeView(grok.View):
+ grok.name('index')
+
+
+.. seealso::
+
+ :class:`grok.Adapter`, :class:`grok.Annotation`,
+ :class:`grok.GlobalUtility`, :class:`grok.Indexes`,
+ :class:`grok.MultiAdapter`, :class:`grok.Role`,
+ :class:`grok.View`
+
+:func:`grok.title`
+========================
+
+.. function:: grok.title(*arg)
+
+ foobar
+
+:func:`grok.implements` -- indicate, that a class implements an interface
+=========================================================================
+
+.. function:: grok.implements(*interfaces)
+
+A class level directive to declare one or more `interfaces`, as implementers
+of the surrounding class. This directive allows several parameters.
+
+:func:`grok.implements` is currently an alias for
+:func:`zope.interface.implements`.
+
+**Example:** ::
+
+ >>> import grok
+ >>> from zope import interface
+ >>> class IPaintable(interface.Interface):
+ ... pass
+ ...
+ >>> class Cave(object):
+ ... pass
+ ...
+ >>> cave = Cave()
+ >>> IPaintable.providedBy(cave)
+ False
+ >>> class PaintableCave(object):
+ ... grok.implements(IPaintable)
+ ...
+ >>> cave = PaintableCave()
+ >>> IPaintable.providedBy(cave)
+ True
+
+:func:`grok.provides`
+=====================
+
+.. function:: grok.provides(interface)
+
+If the component implements more than one interface, :func:`grok.provides`
+is required to disambiguate for what interface the component will be
+registered.
+
+.. seealso::
+
+ :func:`grok.implements`
+
+:func:`grok.adapts` -- Declare that a class adapts certain objects
+==================================================================
+
+.. function:: grok.adapts(*classes_or_interfaces)
+
+A class-level directive to declare that a class adapts objects of the
+classes or interfaces given in `\*classes_or_interfaces`.
+
+This directive accepts several arguments.
+
+It works much like the :mod:`zope.component`\ s :func:`adapts()`, but you do
+not have to make a ZCML entry to register the adapter.
+
+**Example:** ::
+
+ import grok
+ from zope import interface, schema
+ from zope.size.interfaces import ISized
+
+ class IMammoth(interface.Interface):
+ name = schema.TextLine(title=u"Name")
+ size = schema.TextLine(title=u"Size", default=u"Quite normal")
+
+ class Mammoth(grok.Model):
+ interface.implements(IMammoth)
+
+ class MammothSize(object):
+ grok.implements(ISized)
+ grok.adapts(IMammoth)
+
+ def __init__(self, context):
+ self.context = context
+
+ def sizeForSorting(self):
+ return ('byte', 1000)
+
+ def sizeForDisplay(self):
+ return ('1000 bytes')
+
+Having :class:`MammothSize` available, you can register it as an adapter,
+without a single line of ZCML::
+
+ >>> manfred = Mammoth()
+ >>> from zope.component import provideAdapter
+ >>> provideAdapter(MammothSize)
+ >>> from zope.size.interfaces import ISized
+ >>> size = ISized(manfred)
+ >>> size.sizeForDisplay()
+ '1000 bytes'
+
+.. seealso::
+
+ :func:`grok.implements`
+
+:func:`grok.baseclass` -- declare a class as base
+=================================================
+
+.. function:: grok.baseclass()
+
+A class-level directive without argument to mark something as a base class.
+Base classes are are not grokked.
+
+Another way to indicate that something is a base class, is by postfixing the
+classname with ``'Base'``.
+
+The baseclass mark is not inherited by subclasses, so those subclasses will
+be grokked (except they are explicitly declared as baseclasses as well).
+
+**Example:** ::
+
+ import grok
+
+ class ModelBase(grok.Model):
+ pass
+
+ class ViewBase(grok.View):
+ def render(self):
+ return "hello world"
+
+ class AnotherView(grok.View):
+ grok.baseclass()
+
+ def render(self):
+ return "hello world"
+
+ class WorkingView(grok.View):
+ pass
+
+Using this example, only the :class:`WorkingView` will serve as a view,
+while calling the :class:`ViewBase` or :class:`AnotherView` will lead to a
+:exc:`ComponentLookupError`.
+
+Utility directives
+~~~~~~~~~~~~~~~~~~
+
+:func:`grok.global_utility` -- register a global utility
+========================================================
+
+.. function:: grok.global_utility(factory[, provides=None[, name=u'']])
+
+A module level directive to register a global utility.
+
+`factory` - the factory that creates the utility.
+
+`provides` - the interface the utility should be looked up with.
+
+`name` - the name of the utility.
+
+The latter two parameters are optional.
+
+To register the utility correctly, Grok must be able to identify an
+interface provided by the utility. If none is given, Grok checks whether
+(exactly) one interface is implemented by the factory to be registered (see
+example below). If more than one interface is implemented by a class, use
+:func:`grok.provides` to specify which one to use. If no interface is
+implemented by the instances delivered by the factory, use
+:func:`grok.implements` to specify one.
+
+Another way to register global utilities with Grok is to subclass from
+:class:`grok.GlobalUtility`.
+
+**Example:**
+
+ Given the following module code: ::
+
+ import grok
+ from zope import interface
+
+ class IFireplace(interface.Interface):
+ pass
+
+ class Fireplace(object):
+ grok.implements(IFireplace)
+
+ grok.global_utility(Fireplace)
+ grok.global_utility(Fireplace, name='hot')
+
+ Then the following works: ::
+
+ >>> from zope import component
+ >>> fireplace = component.getUtility(IFireplace)
+ >>> IFireplace.providedBy(fireplace)
+ True
+ >>> isinstance(fireplace, Fireplace)
+ True
+
+ >>> fireplace = component.getUtility(IFireplace, name='hot')
+ >>> IFireplace.providedBy(fireplace)
+ True
+ >>> isinstance(fireplace, Fireplace)
+ True
+
+.. seealso::
+
+ :class:`grok.GlobalUtility`, :func:`grok.provides`,
+ :func:`grok.implements`
+
+:func:`grok.local_utility` -- register a local utility
+======================================================
+
+.. function:: grok.local_utility(factory[, provides=None[, name=u''[, setup=None[, public=False[, name_in_container=None]]]]])
+
+A class level directive to register a local utility.
+
+`factory` -- the factory that creates the utility.
+
+`provides` -- the interface the utility should be looked up with.
+
+`name` -- the name of the utility.
+
+`setup` -- a callable that receives the utility as its single
+ argument, it is called after the utility has been created and
+ stored.
+
+`public` -- if `False`, the utility will be stored below
+ `++etc++site`. If `True`, the utility will be stored directly
+ in the site. The site should in this case be a container.
+
+`name_in_container` -- the name to use for storing the utility.
+
+All but the first parameter are optional.
+
+To register a local utility correctly, Grok must know about the interface,
+the utility should be looked up with. If none is given, Grok looks up any
+interfaces implemented by instances delivered by `factory` and if exactly
+one can be found, it is taken. See :func:`grok.global_utility`.
+
+Every single combination of interfaces and names can only be registered once
+per module.
+
+It is not possible to declare a local utility as public, if the site is not
+a container. Grok will remind you of this. To store a utility in a
+container, a `name_in_container` is needed. If none is given, Grok will make
+up one automatically.
+
+An alternative way to define a local utility is to subclass from
+:class:`grok.LocalUtility`.
+
+**Example:**
+
+ The following code registers a local unnamed utility `fireplace` in
+ instances of :class:`Cave` ::
+
+ import grok
+ from zope import interface
+
+ class IFireplace(interface.Interface):
+ pass
+
+ class Fireplace(grok.LocalUtility):
+ grok.implements(IFireplace)
+
+ class Cave(grok.Container, grok.Site):
+ grok.local_utility(Fireplace, public=True,
+ name_in_container='fireplace')
+
+.. seealso::
+
+ :func:`grok.global_utility`, :class:`grok.LocalUtility`
+
+:func:`grok.resourcedir --- XXX Not implemented yet`
+====================================================
+
+.. function:: grok.resourcedir(*arg)
+
+ foobar
+
+Resource directories are used to embed static resources like HTML-,
+JavaScript-, CSS- and other files in your application.
+
+XXX insert directive description here (first: define the name, second:
+describe the default behaviour if the directive isn't given)
+
+A resource directory is created when a package contains a directory with the
+name :file:`static`. All files from this directory become accessible from a
+browser under the URL
+:file:`http://<servername>/++resource++<packagename>/<filename>`.
+
+**Example:**
+
+The package :mod:`a.b.c` is grokked and contains a directory :file:`static`
+which contains the file :file:`example.css`. The stylesheet will be
+available via :file:`http://<servername>/++resource++a.b.c/example.css`.
+
+.. note::
+
+A package can never have both a :file:`static` directory and a Python module
+with the name :file:`static.py` at the same time. grok will remind you of
+this conflict when grokking a package by displaying an error message.
+
+Linking to resources from templates
+-----------------------------------
+
+grok provides a convenient way to calculate the URLs to static resource using
+the keyword :keyword:`static` in page templates::
+
+<link rel="stylesheet" tal:attributes="href static/example.css" type="text/css">
+
+The keyword :keyword:`static` will be replaced by the reference to the resource
+directory for the package in which the template was registered.
+
+Security directives
+~~~~~~~~~~~~~~~~~~~
+
+:func:`grok.require`
+====================
+
+.. function:: grok.require(permission)
+
+A class level directive used to protect a View by requiring a certain permission.
+
+`permission` -- the name of the permission that is required
+
+** Example **::
+
+ class ViewPainting(grok.Permission):
+ grok.name('grok.ViewPainting')
+
+
+.. seealso::
+
+ :class:`grok.Permission` component, :func:`@grok.require` decorator
+
+
+Template directives
+~~~~~~~~~~~~~~~~~~~
+
+:func:`grok.template`
+=====================
+
+.. function:: grok.template(template)
+
+A class level directive used to specify the template to be rendered for the View when no render method is defined.
+
+`template` -- name of the template file
+
+** Convention **
+
+When not specified, Grok will look for a template file with the same name as the view class itself, lowercased, in the templates directory for this module.
+
+.. seealso::
+
+ :func:`grok.templatedir`
+
+:func:`grok.templatedir`
+========================
+
+A module level directive used to specify the directory where Grok should look for template files.
+
+.. function:: grok.templatedir(directory)
+
+`directory` -- the name of the directory inside the same package as the module
+
+** Convention **
+
+When not specified, Grok will look template files in a diretory named `<module>_templates` where `<module>` is the name of the current module.
+
+.. seealso::
+
+ :func:`grok.template`
+
+Uncategorized directives
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+:func:`grok.site`
+=================
+
+.. function:: grok.site(*arg)
+
+A class level directive used in `grok.Indexes` sub-classes to define in which local component registry the indexes should be located.
+
+** Example **
+::
+
+ class MammothIndexes(grok.Indexes):
+ grok.site(Herd)
+ grok.context(IMammoth)
+
+ name = index.Field()
Deleted: grok/branches/ulif-i18n/doc/reference/directives.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/directives.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/directives.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,371 +0,0 @@
-\chapter{Directives}
-
-The \module{grok} module defines a set of directives that allow you to
-configure and register your components. Most directives assume a
-default, based on the environment of a module. (For example, a view
-will be automatically associated with a model if the association can
-be made unambigously.)
-
-If no default can be assumed for a value, grok will explicitly tell
-you what is missing and how you can provide a default or explicit
-assignment for the value in question.
-
-
- \section{\function{grok.AutoFields} -- deduce schema fields automatically}
-
- \begin{funcdesc}{grok.AutoFields}{class_or_interface}
- A class level directive, which can be used inside
- \class{Form} classes to automatically deduce the form fields
- from the schema of the context \var{class_or_interface}.
-
- Different to most other directives,
- \function{grok.AutoFields} is used more like a function and
- less like a pure declaration.
-
- The following example makes use of the
- \function{grok.AutoFields} directive, in that one field is
- omitted from the form before rendering:
-
- \strong{Example:}
-
- \begin{verbatim}
-import grok
-from zope import interface, schema
-
-class IMammoth(interface.Interface):
- name = schema.TextLine(title=u"Name")
- size = schema.TextLine(title=u"Size", default=u"Quite normal")
-
-class Mammoth(grok.Model):
- interface.implements(IMammoth)
-
-class Edit(grok.EditForm):
- grok.context(Mammoth)
-
- form_fields = grok.AutoFields(Mammoth).omit('size')
- \end{verbatim}
-
- In this example the \code{size} attribute will not show up
- in the resulting edit view.
-
- \begin{seealso}
- \class{grok.EditForm}, \class{grok.Fields}
- \end{seealso}
-
- \end{funcdesc}
-
- \section{\function{grok.adapts} -- declare that a class adapts
- certain objects}
-
- \begin{funcdesc}{grok.adapts}{*classes_or_interfaces}
- A class-level directive to declare that a class adapts
- objects of the classes or interfaces given in
- \var{*classes_or_interfaces}.
-
- This directive accepts several arguments.
-
- It works much like the \module{zope.component}s
- \function{adapts()}, but you do not have to make a ZCML
- entry to register the adapter.
-
- \strong{Example:}
-
- \begin{verbatim}
-import grok
-from zope import interface, schema
-from zope.size.interfaces import ISized
-
-class IMammoth(interface.Interface):
- name = schema.TextLine(title=u"Name")
- size = schema.TextLine(title=u"Size", default=u"Quite normal")
-
-class Mammoth(grok.Model):
- interface.implements(IMammoth)
-
-class MammothSize(object):
- grok.implements(ISized)
- grok.adapts(IMammoth)
-
- def __init__(self, context):
- self.context = context
-
- def sizeForSorting(self):
- return ('byte', 1000)
-
- def sizeForDisplay(self):
- return ('1000 bytes')
- \end{verbatim}
-
- Having \class{MammothSize} available, you can register it as
- an adapter, without a single line of ZCML:
-
- \begin{verbatim}
->>> manfred = Mammoth()
->>> from zope.component import provideAdapter
->>> provideAdapter(MammothSize)
->>> from zope.size.interfaces import ISized
->>> size = ISized(manfred)
->>> size.sizeForDisplay()
-'1000 bytes'
- \end{verbatim}
-
- \begin{seealso}
- \class{grok.implements}
- \end{seealso}
-
- \end{funcdesc}
-
- \section{\function{grok.baseclass} -- declare a class as base}
-
- \begin{funcdesc}{grok.baseclass}{}
- A class-level directive without argument to mark something
- as a base class. Base classes are are not grokked.
-
- Another way to indicate that something is a base class, is
- by postfixing the classname with \code{'Base'}.
-
- The baseclass mark is not inherited by subclasses, so those
- subclasses will be grokked (except they are explicitly
- declared as baseclasses as well).
-
- \strong{Example:}
-
- \begin{verbatim}
-import grok
-
-class ModelBase(grok.Model):
- pass
-
-class ViewBase(grok.View):
- def render(self):
- return "hello world"
-
-class AnotherView(grok.View):
- grok.baseclass()
-
- def render(self):
- return "hello world"
-
-class WorkingView(grok.View):
- pass
- \end{verbatim}
-
- Using this example, only the \class{WorkingView} will serve
- as a view, while calling the \class{ViewBase} or
- \class{AnotherView} will lead to a
- \exception{ComponentLookupError}.
-
-
- \end{funcdesc}
-
- \section{\function{grok.define_permission} -- define a permission}
-
- \begin{funcdesc}{grok.define_permission}{name}
-
- A module-level directive to define a permission with name
- \var{name}. Usually permission names are prefixed by a
- component- or application name and a dot to keep them
- unique.
-
- Because in Grok by default everything is accessible by
- everybody, it is important to define permissions, which
- restrict access to certain principals or roles.
-
- \strong{Example:}
-
- \begin{verbatim}
-import grok
-grok.define_permission('cave.enter')
- \end{verbatim}
-
- \begin{seealso}
- \function{grok.require()}, \class{grok.Permission},
- \class{grok.Role}
- \end{seealso}
-
- \versionchanged[replaced by \class{grok.Permission}]{0.11}
-
- \end{funcdesc}
-
-
-
- \section{\function{grok.Fields}}
-
- \begin{funcdesc}{grok.Fields}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.implements}}
-
- \begin{funcdesc}{grok.implements}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.context}}
-
- \begin{funcdesc}{grok.context}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.global_utility}}
-
- \begin{funcdesc}{grok.global_utility}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.localesdir} -- register a
- locales directory}
-
- \begin{funcdesc}{grok.localesdir}{directory}
- A module-level directive, which can be used to register
- a locales directory. It is a Python based equivalent to the
- ZCML directive \code{i18n:registerTranslations}.
-
- If no value is given, the default \code{'locales'} is taken.
-
- The directory must exist in the path given relative to the
- package wherein the directive was used.
-
- The directive takes at most one parameter and can be used
- several times per module.
-
- A \class{GlobalGrokker} is called for every module in a
- grokked package. If a module does not provide a
- \function{grok.localesdir} directive, then
- \code{'locales'} is assumed as default value and tried to be
- registered.
-
- This means especially, that if you do no explicit call to
- \function{localesdir}, but a local directory with
- name \code{locales} and translations exists, then this
- directory will be registered.
-
- You can avoid this behaviour by declaring a different
- locales directory in every module of your package(s) which
- also might be empty.
-
- The following example registers a local \code{locales}
- directory as a source for translations:
-
- If this code resides in a location \code{/foo/bar.py}, then
- Zope will look for translations in \code{/foo/locales}. The
- example is a short form for the following:
-
- \begin{verbatim}
-import grok
-grok.localesdir()
- \end{verbatim}
-
- If this code resides in a location \code{/foo/bar.py}, then
- Zope will look for translations in \code{/foo/locales}. The
- example is a short form for the following:
-
- \begin{verbatim}
-import grok
-grok.localesdir('locales')
- \end{verbatim}
-
- This is the explicit form of the implicit behaviour, if no
- \function{grok.localesdir} is defined explicitly. Different
- to the default behaviour, grok will complain about a
- non-exisiting \code{locales} directory.
-
- You can, given that the given directories exist, declare
- several locale-directories, which will all be parsed:
-
- \begin{verbatim}
-import grok
-grok.localesdir('savannah')
-grok.localesdir('landofoz')
- \end{verbatim}
-
-
- \end{funcdesc}
-
- \section{\function{grok.name}}
-
- \begin{funcdesc}{grok.name}{*arg}
- foobar
- \end{funcdesc}
-
- Used to associate a component with a name. Typically this directive is
- optional. The default behaviour when no name is given depends on the
- component.
-
- \section{\function{grok.local_utility}}
-
- \begin{funcdesc}{grok.local_utility}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.provides}}
-
- \begin{funcdesc}{grok.provides}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.resourcedir --- XXX Not implemented yet}}
-
- \begin{funcdesc}{grok.resourcedir}{*arg}
- foobar
- \end{funcdesc}
-
- Resource directories are used to embed static resources like HTML-,
- JavaScript-, CSS- and other files in your application.
-
- XXX insert directive description here (first: define the name, second:
- describe the default behaviour if the directive isn't given)
-
- A resource directory is created when a package contains a directory
- with the name \file{static}. All files from this directory become
- accessible from a browser under the URL
- \file{http://<servername>/++resource++<packagename>/<filename>}.
-
- \begin{bf}Example:\end{bf} The package \module{a.b.c} is grokked and
- contains a directory \file{static} which contains the file
- \file{example.css}. The stylesheet will be available via
- \file{http://<servername>/++resource++a.b.c/example.css}.
-
- \begin{notice}
- A package can never have both a \file{static} directory and a Python
- module with the name \file{static.py} at the same time. grok will
- remind you of this conflict when grokking a package by displaying an
- error message.
- \end{notice}
-
- \subsection{Linking to resources from templates}
-
- grok provides a convenient way to calculate the URLs to static
- resource using the keyword \keyword{static} in page templates:
-
- \begin{verbatim}
-<link rel="stylesheet" tal:attributes="href static/example.css" type="text/css">
- \end{verbatim}
-
- The keyword \keyword{static} will be replaced by the reference to
- the resource directory for the package in which the template was
- registered.
-
- \section{\function{grok.require}}
-
- \begin{funcdesc}{grok.require}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.site}}
-
- \begin{funcdesc}{grok.site}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.template}}
-
- \begin{funcdesc}{grok.template}{*arg}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.templatedir}}
-
- \begin{funcdesc}{grok.templatedir}{*arg}
- foobar
- \end{funcdesc}
Copied: grok/branches/ulif-i18n/doc/reference/events.rst (from rev 80896, grok/trunk/doc/reference/events.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/events.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/events.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,65 @@
+
+******
+Events
+******
+
+grok provides convenient access to a set of often-used events from Zope 3. Those
+events include object and containment events. All events are available as
+interface and implemented class.
+
+
+grok.IContainerModifiedEvent
+============================
+
+
+grok.IObjectAddedEvent
+======================
+
+
+grok.IObjectCopiedEvent
+=======================
+
+
+grok.IObjectCreatedEvent
+========================
+
+
+grok.IObjectModifiedEvent
+=========================
+
+
+grok.IObjectMovedEvent
+======================
+
+
+grok.IObjectRemovedEvent
+========================
+
+
+grok.ContainerModifiedEvent
+===========================
+
+
+grok.ObjectAddedEvent
+=====================
+
+
+grok.ObjectCopiedEvent
+======================
+
+
+grok.ObjectCreatedEvent
+=======================
+
+
+grok.ObjectModifiedEvent
+========================
+
+
+grok.ObjectMovedEvent
+=====================
+
+
+grok.ObjectRemovedEvent
+=======================
+
Deleted: grok/branches/ulif-i18n/doc/reference/events.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/events.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/events.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,33 +0,0 @@
-\chapter{Events}
-
-grok provides convenient access to a set of often-used events from Zope 3.
-Those events include object and containment events. All events are available as
-interface and implemented class.
-
- \section{grok.IContainerModifiedEvent}
-
- \section{grok.IObjectAddedEvent}
-
- \section{grok.IObjectCopiedEvent}
-
- \section{grok.IObjectCreatedEvent}
-
- \section{grok.IObjectModifiedEvent}
-
- \section{grok.IObjectMovedEvent}
-
- \section{grok.IObjectRemovedEvent}
-
- \section{grok.ContainerModifiedEvent}
-
- \section{grok.ObjectAddedEvent}
-
- \section{grok.ObjectCopiedEvent}
-
- \section{grok.ObjectCreatedEvent}
-
- \section{grok.ObjectModifiedEvent}
-
- \section{grok.ObjectMovedEvent}
-
- \section{grok.ObjectRemovedEvent}
Copied: grok/branches/ulif-i18n/doc/reference/exceptions.rst (from rev 80896, grok/trunk/doc/reference/exceptions.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/exceptions.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/exceptions.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,59 @@
+
+**********
+Exceptions
+**********
+
+grok tries to inform you about errors early and with as much guidance as
+possible. grok can detect some errors already while importing a module, which
+will lead to the :class:`GrokImportError`. Other errors require more context
+and can only be detected while executing the :func:`grok` function.
+
+
+:class:`grok.GrokImportError` -- errors while importing a module
+================================================================
+
+This exception is raised if a grok-specific problem was found while importing a
+module of your application. :class:`GrokImportError` means there was a problem
+in how you are using a part of grok. The error message tries to be as
+informative as possible tell you why something went wrong and how you can fix
+it.
+
+:class:`GrokImportError` is a subclass of Python's :class:`ImportError`.
+
+Examples of situations in which a GrokImportError occurs:
+
+* Using a directive in the wrong context (e.g. grok.templatedir on class-level
+ instead of module-level.)
+
+* Using a decorator with wrong arguments (e.g. grok.subscribe without any
+ argument)
+
+* ...
+
+
+:class:`grok.GrokError` -- errors while grokking a module
+=========================================================
+
+This exception is raised if an error occurs while grokking a module.
+
+Typically a :class:`GrokError` will be raised if one of your modules uses a
+feature of grok that requires some sort of unambigous context to establish a
+reasonable default.
+
+For example, the :class:`grok.View` requires exactly one model to be defined
+locally in the module to assume a default module to be associated with. Having
+no model defined, or more than one model, will lead to an error because the
+context is either underspecified or ambigous.
+
+The error message of a :class:`GrokError` will include the reason for the error,
+the place in your code that triggered the error, and a hint, to help you fix the
+error.
+
+
+.. class:: GrokError(Exception)
+
+
+ .. attribute:: GrokError.component
+
+ The component that was grokked and triggered the error.
+
Deleted: grok/branches/ulif-i18n/doc/reference/exceptions.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/exceptions.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/exceptions.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,49 +0,0 @@
-\chapter{Exceptions}
-
-grok tries to inform you about errors early and with as much guidance as
-possible. grok can detect some errors already while importing a module, which
-will lead to the \class{GrokImportError}. Other errors require more context
-and can only be detected while executing the \function{grok} function.
-
- \section{\class{grok.GrokImportError} -- errors while importing a module}
-
- This exception is raised if a grok-specific problem was found while
- importing a module of your application. \class{GrokImportError} means there
- was a problem in how you are using a part of grok. The error message tries
- to be as informative as possible tell you why something went wrong and how
- you can fix it.
-
- \class{GrokImportError} is a subclass of Python's \class{ImportError}.
-
- Examples of situations in which a GrokImportError occurs:
-
- \begin{itemize}
- \item Using a directive in the wrong context (e.g. grok.templatedir on
- class-level instead of module-level.)
- \item Using a decorator with wrong arguments (e.g. grok.subscribe
- without any argument)
- \item \ldots
- \end{itemize}
-
- \section{\class{grok.GrokError} -- errors while grokking a module}
-
- This exception is raised if an error occurs while grokking a module.
-
- Typically a \class{GrokError} will be raised if one of your modules uses a
- feature of grok that requires some sort of unambigous context to establish
- a reasonable default.
-
- For example, the \class{grok.View} requires exactly one model to be defined
- locally in the module to assume a default module to be associated with.
- Having no model defined, or more than one model, will lead to an error
- because the context is either underspecified or ambigous.
-
- The error message of a \class{GrokError} will include the reason for the
- error, the place in your code that triggered the error, and a hint, to help
- you fix the error.
-
- \begin{classdesc}{GrokError}{Exception}
- \begin{memberdesc}{component}
- The component that was grokked and triggered the error.
- \end{memberdesc}
- \end{classdesc}
Copied: grok/branches/ulif-i18n/doc/reference/functions.rst (from rev 80896, grok/trunk/doc/reference/functions.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/functions.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/functions.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,200 @@
+
+*********
+Functions
+*********
+
+The :mod:`grok` module provides a number of convenience functions to aid in
+common tasks.
+
+
+:func:`grok.AutoFields` -- Deduce and return schema fields automatically
+========================================================================
+
+
+.. function:: grok.AutoFields(class_or_interface)
+
+ This function which can be used inside :class:`Form`
+ classes to automatically deduce the form fields from the schema of
+ the context `class_or_interface`.
+
+ Different to most other directives, :func:`grok.AutoFields` is used
+ more like a function and less like a pure declaration.
+
+ This function is used to create a sequence of form fields from an interface
+ (schema) or from the interfaces (schemas) the context object provides.
+
+ The following example makes use of the :func:`grok.AutoFields`
+ directive, in that one field is omitted from the form before
+ rendering:
+
+**Example:** ::
+
+ import grok
+ from zope import interface, schema
+
+ class IMammoth(interface.Interface):
+ name = schema.TextLine(title=u"Name")
+ size = schema.TextLine(title=u"Size", default=u"Quite normal")
+
+ class Mammoth(grok.Model):
+ interface.implements(IMammoth)
+
+ class Edit(grok.EditForm):
+ grok.context(Mammoth)
+
+ form_fields = grok.AutoFields(Mammoth).omit('size')
+
+In this example the ``size`` attribute will not show up in the
+resulting edit view.
+
+
+.. seealso::
+
+ :class:`grok.EditForm`, :func:`grok.Fields`
+
+:func:`grok.Fields` -- declare schema fields of a form
+======================================================
+
+.. function:: grok.Fields(**schemas)
+
+ A class level directive, which can be used inside :class:`grok.Form`
+ classes.
+
+ A :class:`grok.Fields` can receive keyword parameters with schema
+ fields. These should be available in the definition order.
+
+ **Example:** ::
+
+ import grok
+ from zope import schema
+
+ class Mammoth(grok.Model):
+ pass
+
+ class Edit(grok.EditForm):
+ fields = grok.Fields(
+ b = schema.TextLine(title=u"Beta"),
+ a = schema.TextLine(title=u"Alpha"),
+
+ Given the above code, when the :class:`Edit` form is rendered, the
+ :class:`Textlines` `b` and `a` will appear as input fields in that
+ order. This is due to the fact, that by default the `fields`
+ variable is taken into account, when rendering forms.
+
+ .. seealso::
+
+ :func:`grok.AutoFields`, :class:`grok.Form`
+
+:func:`grok.getSite`
+===============================================
+
+
+.. function:: grok.getSite()
+
+ Get the current site object.
+
+
+ .. seealso::
+
+ Site objects are instances of :class:`grok.Site` and/or
+ :class:`grok.Application`.
+
+
+ .. seealso::
+
+ `Web Component Development With Zope 3, second edition <http://worldcookery.com/WhereToBuy>`_
+ By Philiip von Weitershaussen; Chapter 18 describes the use of Site objects.
+
+
+:func:`grok.notify`
+===================
+
+
+.. function:: grok.notify(event)
+
+ Send `event` to event subscribers.
+
+ Example::
+
+ import grok
+
+ class Mammoth(object):
+ def __init__(self, name):
+ self.name = name
+
+ manfred = Mammoth('manfred')
+
+ grok.notify(grok.ObjectCreatedEvent(manfred))
+
+
+ .. seealso::
+
+ Grok events provide a selection of common event types.
+
+
+ .. seealso::
+
+ `Web Component Development With Zope 3, second edition <http://worldcookery.com/WhereToBuy>`_
+ By Philiip von Weitershaussen; Chapter 16 describes the Zope 3 event system.
+
+
+:func:`grok.url`
+================
+
+
+.. function:: grok.url(request, object, [, name])
+
+ Construct a URL for the given `request` and `object`.
+
+ `name` may be a string that gets appended to the object URL. Commonly used to
+ construct an URL to a particular view on the object.
+
+ This function returns the constructed URL as a string.
+
+
+ .. seealso::
+
+ View classes derived from :class:`grok.View` have a similar :meth:`url` method
+ for constructing URLs.
+
+
+:func:`grok.grok` -- Grok a package or module
+=============================================
+
+
+.. function:: grok(dotted_name)
+
+.. note:: Usually you don't need to invoke this funtion in your code, since it's triggered from the `configure.zcml`. Grokking test fixtures is one situation where it is useful to call this explicitly.
+
+Grokking a package or module activates the contained components (like models,
+views, adapters, templates, etc.) and registers them with Zope 3's component
+architecture.
+
+The `dotted_name` must specify either a Python module or package that is
+available from the current PYTHONPATH.
+
+Grokking a module:
+
+#. Scan the module for known components: models, adapters, utilities, views,
+ traversers, templates and subscribers.
+
+#. Check whether a directory with file system templates exists
+(:file:`<modulename>_templates`). If it exists, load the file system templates
+into the template registry for this module.
+
+#. Determine the module context.
+
+#. Register all components with the Zope 3 component architecture.
+
+#. Initialize schemata for registered models
+
+ Grokking a package:
+
+#. Grok the package as a module.
+
+#. Check for a static resource directory (:file:`static`) and register it if
+it exists.
+
+#. Recursively grok all sub-modules and sub-packages.
+
+
Deleted: grok/branches/ulif-i18n/doc/reference/functions.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/functions.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/functions.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,72 +0,0 @@
-\chapter{Functions}
-
-The \module{grok} module provides a number of convenience functions to aid in
-common tasks.
-
- \section{\function{grok.getSite}}
-
- \begin{funcdesc}{grok.getSite}{}
- Get the current site object.
-
- \begin{seealso}
- Site objects are instances of \class{grok.Site} and/or
- \class{grok.Application}.
- \end{seealso}
-
- \begin{seealso}
- \seetitle
- [http://worldcookery.com/WhereToBuy]
- {Web Component Development With Zope 3, second edition}
- {By Philiip von Weitershaussen; Chapter 18 describes the use of Site
- objects.}
- \end{seealso}
-
- \end{funcdesc}
-
- \section{\function{grok.notify}}
-
- \begin{funcdesc}{grok.notify}{event}
- Send \var{event} to event subscribers.
-
- Example:
-\begin{verbatim}
-import grok
-
-class Mammoth(object):
- def __init__(self, name):
- self.name = name
-
-manfred = Mammoth('manfred')
-
-grok.notify(grok.ObjectCreatedEvent(manfred))
-\end{verbatim}
-
- \begin{seealso}
- Grok events provide a selection of common event types.
- \end{seealso}
-
- \begin{seealso}
- \seetitle
- [http://worldcookery.com/WhereToBuy]
- {Web Component Development With Zope 3, second edition}
- {By Philiip von Weitershaussen; Chapter 16 describes the Zope 3 event
- system.}
- \end{seealso}
-
- \end{funcdesc}
-
- \section{\function{grok.url}}
-
- \begin{funcdesc}{grok.url}{request, object, \optional{, name}}
- Construct a URL for the given \var{request} and \var{object}.
-
- \var{name} may be a string that gets appended to the object URL. Commonly
- used to construct an URL to a particular view on the object.
-
- This function returns the constructed URL as a string.
-
- \begin{seealso}
- View classes derived from \class{grok.View} have a similar \method{url}
- method for constructing URLs.
- \end{seealso}
- \end{funcdesc}
Copied: grok/branches/ulif-i18n/doc/reference/index.rst (from rev 80896, grok/trunk/doc/reference/index.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/index.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/index.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,36 @@
+.. _reference-index:
+
+#################################
+ Grok reference
+#################################
+
+:Release: |version|
+:Date: |today|
+
+ Grok means to understand so thoroughly that the observer becomes a part
+ of the observed -- merge, blend, intermarry, lose identity in group
+ experience. It means almost everything that we mean by religion,
+ philosophy, and science -- it means as little to us (because we are from
+ Earth) as color means to a blind man. -- `Robert A. Heinlein, Stranger in
+ a Strange Land`
+
+
+This is the grok reference documentation. It is organized by the Python
+artefacts that implement the concepts.
+
+Grok makes Zope 3 concepts more accessible for application developers. This
+reference is not intended as introductory material for those concepts. Please
+refer to the original Zope 3 documentation and the grok tutorial for
+introductory material.
+
+
+.. toctree::
+ :maxdepth: 2
+
+ core.rst
+ components.rst
+ directives.rst
+ decorators.rst
+ functions.rst
+ events.rst
+ exceptions.rst
Copied: grok/branches/ulif-i18n/doc/reference/model.rst (from rev 80896, grok/trunk/doc/reference/model.rst)
===================================================================
--- grok/branches/ulif-i18n/doc/reference/model.rst (rev 0)
+++ grok/branches/ulif-i18n/doc/reference/model.rst 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,9 @@
+
+**********
+grok.Model
+**********
+
+
+Models
+======
+
Deleted: grok/branches/ulif-i18n/doc/reference/model.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/model.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/model.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,3 +0,0 @@
-\chapter{grok.Model}
-
- \section{Models}
Deleted: grok/branches/ulif-i18n/doc/reference/reference.tex
===================================================================
--- grok/branches/ulif-i18n/doc/reference/reference.tex 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/doc/reference/reference.tex 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,71 +0,0 @@
-% Complete documentation on the extended LaTeX markup used for Python
-% documentation is available in ``Documenting Python'', which is part
-% of the standard documentation for Python. It may be found online
-% at:
-%
-% http://www.python.org/doc/current/doc/doc.html
-
-\documentclass{manual}
-\RequirePackage[latin9]{inputenc}
-\usepackage{graphicx}
-
-\title{grok reference}
-
-% Please at least include a long-lived email address;
-% the rest is at your discretion.
-\authoraddress{
- The grok team\\
- Email: $<$grok-dev at zope.org$>$
-}
-
-\date{\today} % update before release!
- % Use an explicit date so that reformatting
- % doesn't cause a new date to be used. Setting
- % the date to \today can be used during draft
- % stages to make it easier to handle versions.
-
-\release{unreleased} % release version; this is used to define the
- % \version macro
-
-\makeindex % tell \index to actually write the .idx file
-
-\begin{document}
-
-\maketitle
-
- \begin{quote}
- ``Grok means to understand so thoroughly that the observer becomes a part
- of the observed --- merge, blend, intermarry, lose identity in group
- experience. It means almost everything that we mean by religion,
- philosophy, and science --- it means as little to us (because we are from
- Earth) as color means to a blind man.'' -- Robert A. Heinlein, Stranger in
- a Strange Land
- \end{quote}
-
-\begin{abstract}
-This is the grok reference documentation. It is organized by the Python
-artefacts that implement the concepts.
-
-Grok makes Zope 3 concepts more accessible for application developers. This
-reference is not intended as introductory material for those concepts. Please
-refer to the original Zope 3 documentation and the grok tutorial for
-introductory material.
-\end{abstract}
-
-\tableofcontents
-
-\include{core}
-
-\include{components}
-
-\include{directives}
-
-\include{decorators}
-
-\include{functions}
-
-\include{events}
-
-\include{exceptions}
-
-\end{document}
Modified: grok/branches/ulif-i18n/setup.py
===================================================================
--- grok/branches/ulif-i18n/setup.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/setup.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,13 +1,6 @@
from setuptools import setup, find_packages
import os
-# some of the dependencies containing C code have been hardcoded to
-# make sure we only depend on versions for which there is a windows
-# binary. In some cases this means we rely on an earlier version than the
-# latest/greatest version as no Windows binary has been released for it yet.
-# in some cases we also need to do this for non-binary dependencies, as
-# more recent versions rely on versions for which no binary eggs exist.
-
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
@@ -20,8 +13,6 @@
'********\n'
)
-open('doc.txt', 'w').write(long_description)
-
setup(
name='grok',
version='0.11dev',
@@ -47,7 +38,7 @@
'martian',
'simplejson',
'pytz',
- 'ZODB3 == 3.8.0b2',
+ 'ZODB3',
'zope.annotation',
'zope.app.apidoc',
'zope.app.applicationcontrol',
@@ -55,11 +46,10 @@
'zope.app.authentication',
'zope.app.catalog',
'zope.app.component',
- 'zope.app.container == 3.5.0.a1',
+ 'zope.app.container',
'zope.app.folder',
'zope.app.intid',
- # not binary, but needed for ZODB 3.8.0b2
- 'zope.app.keyreference == 3.4.0a1',
+ 'zope.app.keyreference',
'zope.app.pagetemplate',
'zope.app.publication',
'zope.app.publisher',
@@ -78,17 +68,17 @@
'zope.hookable',
'zope.i18n',
'zope.i18nmessageid',
- 'zope.interface == 3.4.0',
+ 'zope.interface',
'zope.lifecycleevent',
'zope.pagetemplate',
- 'zope.proxy == 3.4.0',
+ 'zope.proxy',
'zope.publisher',
'zope.schema',
- 'zope.security == 3.4.0b5',
+ 'zope.security',
'zope.testing',
'zope.traversing',
'zope.testbrowser',
'zc.catalog',
- 'z3c.flashmessage >=1.0b1',
+ 'z3c.flashmessage',
],
)
Modified: grok/branches/ulif-i18n/src/grok/__init__.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/__init__.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/__init__.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -36,9 +36,10 @@
from grok.components import Application, Form, AddForm, EditForm, DisplayForm
from grok.components import Indexes
from grok.components import Permission, Role
+from grok.components import Skin, IGrokLayer
from grok.directive import (context, name, title, template, templatedir,
provides, baseclass, global_utility, local_utility,
- permissions, require, site)
+ permissions, require, site, layer)
from grok.i18n import localesdir
from grok._grok import do_grok as grok # Avoid name clash within _grok
from grok._grok import grok_component
Modified: grok/branches/ulif-i18n/src/grok/_grok.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/_grok.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/_grok.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -72,13 +72,16 @@
from zope.testing.cleanup import addCleanUp
addCleanUp(resetBootstrap)
+def skip_tests(name):
+ return name in ['tests', 'ftests']
def do_grok(dotted_name):
global _bootstrapped
if not _bootstrapped:
bootstrap()
_bootstrapped = True
- martian.grok_dotted_name(dotted_name, the_module_grokker)
+ martian.grok_dotted_name(
+ dotted_name, the_module_grokker, exclude_filter=skip_tests)
def grok_component(name, component,
context=None, module_info=None, templates=None):
@@ -88,7 +91,8 @@
templates=templates)
def prepare_grok(name, module, kw):
- module_info = scan.module_info_from_module(module)
+ module_info = scan.module_info_from_module(
+ module, exclude_filter=skip_tests)
# XXX hardcoded in here which base classes are possible contexts
# this should be made extensible
@@ -136,6 +140,7 @@
if subscribers is None:
frame.f_locals['__grok_subscribers__'] = subscribers = []
subscribers.append((function, self.subscribed))
+ return function
from zope.component._declaration import adapter as _adapter
class adapter(_adapter):
Modified: grok/branches/ulif-i18n/src/grok/admin/docgrok.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/admin/docgrok.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/admin/docgrok.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -35,7 +35,6 @@
from zope.security.proxy import removeSecurityProxy
from zope.proxy import removeAllProxies
-from zope.app.i18n import ZopeMessageFactory as _
from zope.app.apidoc.codemodule.module import Module
from zope.app.apidoc.codemodule.class_ import Class
from zope.app.apidoc.codemodule.text import TextFile
Modified: grok/branches/ulif-i18n/src/grok/admin/objectinfo.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/admin/objectinfo.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/admin/objectinfo.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -567,246 +567,3 @@
or getattr(self.obj, 'id', None)
or getattr(self.obj, '_o_id', None))
-
-from zope.traversing.interfaces import ITraversable
-from zope.app.folder.interfaces import IRootFolder
-from zope.location import LocationProxy
-class AnnotationsTraverser(grok.Traverser):
- """If first URL element is '++anno++', handle over to
- ObjectBrowser.
-
- This traverser binds to the RootFolder, which means, it is only
- asked, when the publisher looks for elements in the Zope root (or
- another IRootFolder). The further traversing is done by the Docs'
- own traverser in it's model. See method `traverse()` in DocGrok.
- """
- grok.context(Interface)
- #grok.name('anno')
- #grok.provides(ITraversable)
-
- def traverse(self,path):
- namespace = 'anno'
- if path.startswith(namespace):
- name = path[len(namespace):]
- naked = removeSecurityProxy(self.context)
- annotations = IAnnotations(naked)
- obj = ObjectInfo("Hello")
- if not IPhysicallyLocatable(obj, False):
- obj = LocationProxy(
- obj, self.context, 'anno' + name)
- return obj
- return
-
- def render(self):
- pass
-
-##
-## This comes from Dieter Maurer:
-##
-
-def determineClass(o):
- return hasattr(o, '__class__') and o.__class__ or type(o)
-
-class Recorder(object):
- def __init__(self): self._account = {}
- def __call__(self, o):
- a = self._account
- class_ = determineClass(o)
- if class_ in a: a[class_] += 1
- else: a[class_] = 1
- def account(self): return self._account
-
-def sortRecords(recorder):
- return sorted(recorder.account().items(), key=lambda r: r[1], reverse=True)
-
-def fix((ty, no)):
- '''some types apparently have a broken 'str'. Fix this.'''
- try: tyn = str(ty)
- except TypeError:
- try: tyn = 'BROKEN-STR: %r' % ty
- except TypeError: tyn = 'BROKEN-STR-AND-REPR'
- return tyn, no
-
-def analyseObjects(limit=100):
- '''analyses live objects and garbage.
-
- The result is a pair with information for live and garbage objects, respectively.
- The information is a dict with keys 'count' and 'sorted'.
- 'count' is the total number of objects, 'sorted' a list with pairs
- 'type' and 'instanceCount', inverse sorted by 'instanceCount'.
- '''
- result = []
- import gc
- for objs in gc.get_objects(), gc.garbage:
- r = Recorder()
- for o in objs: r(o)
- result.append({
- 'count':len(objs),
- 'sorted':map(fix, sortRecords(r)[:limit]),
- })
- return result
-
-
-
-
-
-
-
-
-
-
-
-
-class ObjectInfo_obsolete(object):
- """A wrapper to provide object specific information.
-
- This is the base wrapper.
-
- See inspect.txt to learn more about this kind of thing.
- """
-
- def __init__(self, obj):
- self.obj = obj
-
- def getName(self):
- """Try to determine the name of an object.
- """
- for key in ['__name__', 'id', 'title', '_o_id']:
- name = getattr(self.obj, key, None)
- if name is not None:
- break
- return name
-
- def getDoc(self):
- """Fetch any doc strings from the wrapped object.
- """
- if hasattr(self.obj, '__class__'):
- return getattr(self.obj.__class__, '__doc__', None)
- return
-
- def getType(self):
- """Get the wrapped objects' type as a string in dotted path
- notation.
- """
- return type(self.obj)
-
- def getParent(self):
- """Get the parent of the wrapped object.
-
- This might result in a `TypeError` if the wrapped object is
- not locatable in sense of ILocation, i.e. if it doesn't
- provide ``__parent__`` attribute.
- """
- return getParent(self.obj)
-
- def getChildren(self):
- """Returns a list of children objects.
- """
- return dir(self.obj)
-
- def getRoot(self):
- """Get the root obj of the wrapped object.
- """
- try:
- return getRoot(self.obj)
- except TypeError:
- tmp = self.obj
- while getattr(tmp, '__parent__', None):
- tmp = tmp.__parent__
- return tmp
- return
-
- def isRoot(self):
- """Check, whether the wrapped object is the root within its branch.
-
- This does of course not necessarily mean, it is also the root
- of the whole instance.
- """
- try:
- return self.getRoot() == self.obj
- except TypeError:
- if getattr(self.obj, '__parent__', True) is None:
- return True
- return False
-
- def is_broken(self):
- """Check, whether the wrapped object is broken.
- """
- # XXX to be implemented.
- return
-
-
-class DCObjectInfo(ObjectInfo_obsolete):
- """An object wrapper, that provides DublinCore related information.
-
- If such information is not available (for instance, because the
- type of object can't be adapted), None is returned for every
- value. It is therefore safe to use this info type also for objects
- not supporting DC.
- """
- obj = None
- supports_dc = False
- _metadata = None
- _covered_keys = [ 'created', 'modified', 'effective', 'expires',
- 'publisher', 'creators', 'subjects', 'contributors',
- 'description', 'title']
-
-
- def __init__(self, obj):
-
- super(ObjectInfo, self).__init__(obj)
- self.obj = obj
- try:
- dc = IZopeDublinCore(self.obj)
- self._metadata = dict((field, getattr(dc, field))
- for field in getFields(IZopeDublinCore) if hasattr(dc, field))
- self.supports_dc = True
- except TypeError:
- # A type error occurs, when obj can't be adapted to
- # IZopeDublinCore.
- self._metadata = dict([(x,None) for x in self._covered_keys])
-
-
- def _getDCEntry(self, category):
- if category in self._metadata.keys() and self._metadata[category]:
- return self._metadata[category]
- return
-
-
-
- def getDCMisc(self):
- """Get dict of DC metadata not covered by other methods.
- """
- return dict([x for x in self._metadata.items()
- if x[0] not in self.covered_keys])
-
- def getDCTitle(self):
- return self._getDCEntry('title') or u''
-
- def getDCDescription(self):
- return self._getDCEntry('description') or u''
-
- def getDCCreators(self):
- return self._getDCEntry('creators') or ()
-
- def getDCContributors(self):
- return self._getDCEntry('contributors') or ()
-
- def getDCSubjects(self):
- return self._getDCEntry('subjects') or ()
-
- def getDCPublisher(self):
- return self._getDCEntry('publisher') or u''
-
- def getDCCreationDate(self):
- return self._getDCEntry('created') or u''
-
- def getDCModificationDate(self):
- return self._getDCEntry('modified') or u''
-
- def getDCEffectiveDate(self):
- return self._getDCEntry('effective') or u''
-
- def getDCExpiringDate(self):
- return self._getDCEntry('expires') or u''
-
Modified: grok/branches/ulif-i18n/src/grok/components.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/components.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/components.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -23,10 +23,9 @@
from zope import component
from zope import interface
-from zope import schema
-from zope import event
from zope.interface.common import idatetime
-from zope.lifecycleevent import ObjectModifiedEvent
+from zope.security.permission import Permission
+from zope.app.securitypolicy.role import Role
from zope.publisher.browser import BrowserPage
from zope.publisher.interfaces import NotFound
from zope.publisher.interfaces.browser import (IBrowserPublisher,
@@ -34,9 +33,6 @@
from zope.publisher.publish import mapply
from zope.pagetemplate import pagetemplate, pagetemplatefile
from zope.formlib import form
-from zope.traversing.browser.interfaces import IAbsoluteURL
-from zope.traversing.browser.absoluteurl import AbsoluteURL
-from zope.traversing.browser.absoluteurl import _safe as SAFE_URL_CHARACTERS
from zope.annotation.interfaces import IAttributeAnnotatable
from zope.app.pagetemplate.engine import TrustedAppPT
@@ -102,6 +98,7 @@
def __init__(self, context, request):
super(View, self).__init__(context, request)
+ self.__name__ = self.__view_name__
self.static = component.queryAdapter(
self.request,
interface.Interface,
@@ -176,14 +173,6 @@
source.send(message, type)
-class GrokViewAbsoluteURL(AbsoluteURL):
-
- def _getContextName(self, context):
- return getattr(context, '__view_name__', None)
- # XXX breadcrumbs method on AbsoluteURL breaks as it does not use
- # _getContextName to get to the name of the view. What does breadcrumbs do?
-
-
class XMLRPC(object):
pass
@@ -480,8 +469,14 @@
Indexes = IndexesClass('Indexes')
-class Permission(object):
+class Permission(Permission):
pass
-class Role(object):
+class Role(Role):
pass
+
+class IGrokLayer(interface.Interface):
+ pass
+
+class Skin(object):
+ pass
Modified: grok/branches/ulif-i18n/src/grok/configure.zcml
===================================================================
--- grok/branches/ulif-i18n/src/grok/configure.zcml 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/configure.zcml 2007-10-17 22:22:36 UTC (rev 80908)
@@ -28,28 +28,6 @@
<securityPolicy
component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
- <!-- we register special IAbsoluteURL views on grok views so that
- can have them inspect __view_name__ instead of __name__.
- __name__ is already used as the class name, and overriding it
- may make error messages more confusing. -->
-
- <view
- for=".interfaces.IGrokView"
- name="absolute_url"
- factory=".components.GrokViewAbsoluteURL"
- type="zope.publisher.interfaces.http.IHTTPRequest"
- permission="zope.Public"
- allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
- />
-
- <view
- for=".interfaces.IGrokView"
- factory=".components.GrokViewAbsoluteURL"
- type="zope.publisher.interfaces.http.IHTTPRequest"
- permission="zope.Public"
- provides="zope.traversing.browser.interfaces.IAbsoluteURL"
- />
-
<!-- this overrides Zope 3's publication factories because they have
the same name; we also need to change the priority because of
the ZCML discriminator -->
Modified: grok/branches/ulif-i18n/src/grok/directive.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/directive.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/directive.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -120,3 +120,5 @@
title = SingleTextDirective('grok.title', ClassDirectiveContext())
permissions = MultiValueOnceDirective(
'grok.permissions', ClassDirectiveContext())
+layer = InterfaceOrClassDirective('grok.layer',
+ ClassOrModuleDirectiveContext())
Modified: grok/branches/ulif-i18n/src/grok/formlib.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/formlib.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/formlib.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -27,38 +27,15 @@
fields.sort(key=lambda field: field.order)
return form.Fields(*(args + tuple(fields)), **kw)
-def get_context_schema_fields(context):
- """Get the schema fields for a context object.
- """
- fields = []
- fields_class = getattr(context, 'fields', None)
- # bail out if there is no fields attribute at all
- if fields_class is None:
- return fields
- # bail out if there's a fields attribute but it isn't an old-style class
- if type(fields_class) != types.ClassType:
- return fields
- # get the fields from the class
- for name in dir(fields_class):
- field = getattr(fields_class, name)
- if IField.providedBy(field):
- if not getattr(field, '__name__', None):
- field.__name__ = name
- fields.append(field)
- fields.sort(key=lambda field: field.order)
- return fields
-
def get_auto_fields(context):
"""Get the form fields for context.
"""
# for an interface context, we generate them from that interface
if IInterface.providedBy(context):
return form.Fields(context)
- # if we have a non-interface context,
- # we're autogenerating them from any model-specific
- # fields along with any schemas defined by the context
- fields = form.Fields(*get_context_schema_fields(context))
- fields += form.Fields(*most_specialized_interfaces(context))
+ # if we have a non-interface context, we're autogenerating them
+ # from any schemas defined by the context
+ fields = form.Fields(*most_specialized_interfaces(context))
# we pull in this field by default, but we don't want it in our form
fields = fields.omit('__name__')
return fields
Modified: grok/branches/ulif-i18n/src/grok/ftests/form/actions.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/ftests/form/actions.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/ftests/form/actions.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -45,11 +45,18 @@
"""
import grok
from zope import schema
+from zope.interface import Interface, implements
+from zope.schema.fieldproperty import FieldProperty
+class IMammoth(Interface):
+ name = schema.TextLine(title=u"Name")
+ size = schema.TextLine(title=u"Size", default=u"Quite normal")
+
class Mammoth(grok.Model):
- class fields:
- name = schema.TextLine(title=u"Name")
- size = schema.TextLine(title=u"Size")
+ implements(IMammoth)
+
+ name = FieldProperty(IMammoth['name'])
+ size = FieldProperty(IMammoth['size'])
class Edit(grok.EditForm):
@grok.action("Apply")
Modified: grok/branches/ulif-i18n/src/grok/ftests/form/addform.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/ftests/form/addform.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/ftests/form/addform.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -27,14 +27,17 @@
"""
import grok
from zope import schema
+from zope.interface import Interface, implements
class Zoo(grok.Container):
pass
+class IMammoth(Interface):
+ name = schema.TextLine(title=u"Name")
+ size = schema.TextLine(title=u"Size", default=u"Quite normal")
+
class Mammoth(grok.Model):
- class fields:
- name = schema.TextLine(title=u"Name")
- size = schema.TextLine(title=u"Size")
+ implements(IMammoth)
def __init__(self, name='', size=''):
self.name = name
Deleted: grok/branches/ulif-i18n/src/grok/ftests/form/editform_applydata_classfields.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/ftests/form/editform_applydata_classfields.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/ftests/form/editform_applydata_classfields.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,72 +0,0 @@
-"""
-A grok.EditForm uses applyData in update mode to save the form data on
-the object. Update mode means that only those fields are changed on
-the object that need to be changed.
-
-This is essentially the same narrative as 'editform_applydata'. Here
-we test the whole procedure on fields defined on the model class:
-
- >>> getRootFolder()["manfred"] = mammoth = Mammoth()
- >>> mammoth.name = 'Manfred the Mammoth'
- >>> mammoth.size = 'Really big'
-
- >>> from zope.testbrowser.testing import Browser
- >>> browser = Browser()
- >>> browser.handleErrors = False
-
-If we don't change any of the fields, there will no object modified
-event and applyData will report no changes:
-
- >>> browser.open("http://localhost/manfred/@@edit")
- >>> browser.getControl("Apply").click()
- >>> 'No changes' in browser.contents
- True
-
-If we change one field, only that attribute will be changed. The
-object modified event also reflects that:
-
- >>> browser.getControl(name="form.name").value = "Manfred the Big Mammoth"
- >>> browser.getControl("Apply").click()
- An IObjectModifiedEvent was sent for a mammoth with the following changes:
- name
- >>> 'Updated' in browser.contents
- True
-
-Let's change the other field:
-
- >>> browser.getControl(name="form.size").value = "Enormously big"
- >>> browser.getControl("Apply").click()
- An IObjectModifiedEvent was sent for a mammoth with the following changes:
- size
- >>> 'Updated' in browser.contents
- True
-
-And finally let's change both fields:
-
- >>> browser.getControl(name="form.name").value = "Manfred the Mammoth"
- >>> browser.getControl(name="form.size").value = "Really big"
- >>> browser.getControl("Apply").click()
- An IObjectModifiedEvent was sent for a mammoth with the following changes:
- name, size
- >>> 'Updated' in browser.contents
- True
-
-"""
-import grok
-from zope import schema
-
-
-class Mammoth(grok.Model):
- class fields:
- name = schema.TextLine(title=u"Name")
- size = schema.TextLine(title=u"Size")
-
-class Edit(grok.EditForm):
- pass
-
- at grok.subscribe(Mammoth, grok.IObjectModifiedEvent)
-def notify_change_event(mammoth, event):
- print ("An IObjectModifiedEvent was sent for a mammoth with the "
- "following changes:")
- for descr in event.descriptions:
- print ", ".join(descr.attributes)
Copied: grok/branches/ulif-i18n/src/grok/ftests/form/editform_applydata_schemafields.py (from rev 80896, grok/trunk/src/grok/ftests/form/editform_applydata_schemafields.py)
===================================================================
--- grok/branches/ulif-i18n/src/grok/ftests/form/editform_applydata_schemafields.py (rev 0)
+++ grok/branches/ulif-i18n/src/grok/ftests/form/editform_applydata_schemafields.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,75 @@
+"""
+A grok.EditForm uses applyData in update mode to save the form data on
+the object. Update mode means that only those fields are changed on
+the object that need to be changed.
+
+This is essentially the same narrative as 'editform_applydata'. Here we
+test the whole procedure on fields on the interface implemented by the
+model class:
+
+ >>> getRootFolder()["manfred"] = mammoth = Mammoth()
+ >>> mammoth.name = 'Manfred the Mammoth'
+ >>> mammoth.size = 'Really big'
+
+ >>> from zope.testbrowser.testing import Browser
+ >>> browser = Browser()
+ >>> browser.handleErrors = False
+
+If we don't change any of the fields, there will no object modified
+event and applyData will report no changes:
+
+ >>> browser.open("http://localhost/manfred/@@edit")
+ >>> browser.getControl("Apply").click()
+ >>> 'No changes' in browser.contents
+ True
+
+If we change one field, only that attribute will be changed. The
+object modified event also reflects that:
+
+ >>> browser.getControl(name="form.name").value = "Manfred the Big Mammoth"
+ >>> browser.getControl("Apply").click()
+ An IObjectModifiedEvent was sent for a mammoth with the following changes:
+ name
+ >>> 'Updated' in browser.contents
+ True
+
+Let's change the other field:
+
+ >>> browser.getControl(name="form.size").value = "Enormously big"
+ >>> browser.getControl("Apply").click()
+ An IObjectModifiedEvent was sent for a mammoth with the following changes:
+ size
+ >>> 'Updated' in browser.contents
+ True
+
+And finally let's change both fields:
+
+ >>> browser.getControl(name="form.name").value = "Manfred the Mammoth"
+ >>> browser.getControl(name="form.size").value = "Really big"
+ >>> browser.getControl("Apply").click()
+ An IObjectModifiedEvent was sent for a mammoth with the following changes:
+ name, size
+ >>> 'Updated' in browser.contents
+ True
+
+"""
+import grok
+from zope import schema
+from zope.interface import Interface, implements
+
+class IMammoth(Interface):
+ name = schema.TextLine(title=u"Name")
+ size = schema.TextLine(title=u"Size", default=u"Quite normal")
+
+class Mammoth(grok.Model):
+ implements(IMammoth)
+
+class Edit(grok.EditForm):
+ pass
+
+ at grok.subscribe(Mammoth, grok.IObjectModifiedEvent)
+def notify_change_event(mammoth, event):
+ print ("An IObjectModifiedEvent was sent for a mammoth with the "
+ "following changes:")
+ for descr in event.descriptions:
+ print ", ".join(descr.attributes)
Modified: grok/branches/ulif-i18n/src/grok/ftests/form/form.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/ftests/form/form.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/ftests/form/form.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -28,11 +28,18 @@
"""
import grok
from zope import schema
+from zope.interface import Interface, implements
+from zope.schema.fieldproperty import FieldProperty
+class IMammoth(Interface):
+ name = schema.TextLine(title=u"Name")
+ size = schema.TextLine(title=u"Size", default=u"Quite normal")
+
class Mammoth(grok.Model):
- class fields:
- name = schema.TextLine(title=u"Name")
- size = schema.TextLine(title=u"Size")
+ implements(IMammoth)
+
+ name = FieldProperty(IMammoth['name'])
+ size = FieldProperty(IMammoth['size'])
class Edit(grok.EditForm):
pass
Modified: grok/branches/ulif-i18n/src/grok/ftests/form/update.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/ftests/form/update.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/ftests/form/update.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -45,9 +45,15 @@
import grok
from zope import schema
+from zope.interface import Interface, implements
+
+class IMammoth(Interface):
+ name = schema.TextLine(title=u"Name")
+
class Mammoth(grok.Model):
- class fields:
- name = schema.TextLine(title=u"Name", default=u'Manfred')
+ implements(IMammoth)
+
+ name = u'Manfred'
class Index(grok.View):
Copied: grok/branches/ulif-i18n/src/grok/ftests/view/layers.py (from rev 80896, grok/trunk/src/grok/ftests/view/layers.py)
===================================================================
--- grok/branches/ulif-i18n/src/grok/ftests/view/layers.py (rev 0)
+++ grok/branches/ulif-i18n/src/grok/ftests/view/layers.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,63 @@
+"""
+ >>> getRootFolder()["manfred"] = Mammoth()
+
+ >>> from zope.testbrowser.testing import Browser
+ >>> browser = Browser()
+ >>> browser.handleErrors = False
+ >>> browser.open("http://localhost/++skin++Basic/manfred/@@cavedrawings")
+ >>> print browser.contents
+ <html>
+ <body>
+ <h1>Hello, world!</h1>
+ </body>
+ </html>
+
+ >>> browser.open("http://localhost/++skin++Rotterdam/manfred/@@moredrawings")
+ >>> print browser.contents
+ Pretty
+
+ >>> browser.open("http://localhost/++skin++myskin/manfred/@@evenmoredrawings")
+ >>> print browser.contents
+ Awesome
+
+"""
+import grok
+from zope.app.basicskin import IBasicSkin
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.app.rotterdam import rotterdam
+from zope import interface
+
+grok.layer(IBasicSkin)
+
+class MySkinLayer(grok.IGrokLayer):
+ pass
+
+class MySkin(grok.Skin):
+ grok.layer(MySkinLayer)
+
+class Mammoth(grok.Model):
+ pass
+
+class CaveDrawings(grok.View):
+ pass
+
+cavedrawings = grok.PageTemplate("""\
+<html>
+<body>
+<h1>Hello, world!</h1>
+</body>
+</html>
+""")
+
+class MoreDrawings(grok.View):
+ grok.layer(rotterdam)
+
+ def render(self):
+ return "Pretty"
+
+
+class EvenMoreDrawings(grok.View):
+ grok.layer(MySkinLayer)
+
+ def render(self):
+ return "Awesome"
Modified: grok/branches/ulif-i18n/src/grok/interfaces.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/interfaces.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/interfaces.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -42,6 +42,8 @@
EditForm = interface.Attribute("Base class for edit forms.")
DisplayForm = interface.Attribute("Base class for display forms.")
Indexes = interface.Attribute("Base class for catalog index definitions.")
+ Layer = interface.Attribute("Base interface for layers.")
+ Skin = interface.Attribute("Base class for skin.")
class IGrokErrors(interface.Interface):
@@ -76,6 +78,17 @@
This directive can only be used on class level."""
+ def layer(layer):
+ """Declare the layer for the view.
+
+ This directive acts as a contraint on the 'request' of
+ grok.View. This directive can only be used on class level."""
+
+ def skin(skin):
+ """Declare this layer as a named skin.
+
+ This directive can only be used on class level."""
+
def template(template):
"""Declare the template name for a view.
Modified: grok/branches/ulif-i18n/src/grok/meta.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/meta.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/meta.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -19,10 +19,10 @@
from zope import interface, component
from zope.publisher.interfaces.browser import (IDefaultBrowserLayer,
IBrowserRequest,
- IBrowserPublisher)
+ IBrowserPublisher,
+ IBrowserSkinType)
from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
from zope.security.permission import Permission
-from zope.security.interfaces import IPermission
from zope.app.securitypolicy.role import Role
from zope.app.securitypolicy.rolepermission import rolePermissionManager
@@ -49,23 +49,6 @@
from grok.util import check_adapts, get_default_permission, make_checker
-class ModelGrokker(martian.ClassGrokker):
- component_class = grok.Model
-
- def grok(self, name, factory, context, module_info, templates):
- for field in formlib.get_context_schema_fields(factory):
- setattr(factory, field.__name__, field.default)
- return True
-
-
-class ContainerGrokker(ModelGrokker):
- component_class = grok.Container
-
-
-class LocalUtilityGrokker(ModelGrokker):
- component_class = grok.LocalUtility
-
-
class AdapterGrokker(martian.ClassGrokker):
component_class = grok.Adapter
@@ -142,6 +125,7 @@
component_class = grok.View
def grok(self, name, factory, context, module_info, templates):
+
view_context = util.determine_class_context(factory, context)
factory.module_info = module_info
@@ -191,12 +175,15 @@
raise GrokError("View %r has no associated template or "
"'render' method." % factory, factory)
+ # grab layer from class or module
+ view_layer = determine_class_directive('grok.layer', factory, module_info, default=IDefaultBrowserLayer)
+
view_name = util.class_annotation(factory, 'grok.name',
factory_name)
# __view_name__ is needed to support IAbsoluteURL on views
factory.__view_name__ = view_name
component.provideAdapter(factory,
- adapts=(view_context, IDefaultBrowserLayer),
+ adapts=(view_context, view_layer),
provides=interface.Interface,
name=view_name)
@@ -497,18 +484,19 @@
priority = 1500
def grok(self, name, factory, context, module_info, templates):
- permission_name = util.class_annotation(factory, 'grok.name', None)
- if permission_name is None:
+ id = util.class_annotation(factory, 'grok.name', None)
+ if id is None:
raise GrokError(
"A permission needs to have a dotted name for its id. Use "
"grok.name to specify one.", factory)
- permission_name = unicode(permission_name)
- title = unicode(
- util.class_annotation(factory, 'grok.title', permission_name))
- # TODO permission description
- component.provideUtility(
- Permission(permission_name, title=title),
- name=permission_name)
+ # We can safely convert to unicode, since the directives make sure
+ # it is either unicode already or ASCII.
+ id = unicode(id)
+ permission = factory(
+ id,
+ unicode(util.class_annotation(factory, 'grok.title', id)),
+ unicode(util.class_annotation(factory, 'grok.description', '')))
+ component.provideUtility(permission, name=id)
return True
class DefineRoleGrokker(martian.ClassGrokker):
@@ -516,17 +504,22 @@
priority = DefinePermissionGrokker.priority - 1
def grok(self, name, factory, context, module_info, templates):
- role_name = util.class_annotation(factory, 'grok.name', None)
- if role_name is None:
+ id = util.class_annotation(factory, 'grok.name', None)
+ if id is None:
raise GrokError(
"A role needs to have a dotted name for its id. Use "
"grok.name to specify one.", factory)
- title = unicode(util.class_annotation(factory, 'grok.title', role_name))
- component.provideUtility(Role(role_name, title=title), name=role_name)
-
+ # We can safely convert to unicode, since the directives makes sure
+ # it is either unicode already or ASCII.
+ id = unicode(id)
+ role = factory(
+ id,
+ unicode(util.class_annotation(factory, 'grok.title', id)),
+ unicode(util.class_annotation(factory, 'grok.description', '')))
+ component.provideUtility(role, name=id)
permissions = util.class_annotation(factory, 'grok.permissions', ())
for permission in permissions:
- rolePermissionManager.grantPermissionToRole(permission, role_name)
+ rolePermissionManager.grantPermissionToRole(permission, id)
return True
class AnnotationGrokker(martian.ClassGrokker):
@@ -631,6 +624,7 @@
"""Create the catalog if needed and return it.
If the catalog already exists, return that.
+
"""
catalog = zope.component.queryUtility(
ICatalog, name=self.catalog_name, context=site, default=None)
@@ -685,3 +679,25 @@
None)
grok.i18n.registerTranslationsDirectory(abs_path)
return True
+
+
+class SkinGrokker(martian.ClassGrokker):
+ component_class = grok.Skin
+
+ def grok(self, name, factory, context, module_info, templates):
+
+ layer = determine_class_directive('grok.layer', factory, module_info, default=IBrowserRequest)
+ name = grok.util.class_annotation(factory, 'grok.name', factory.__name__.lower())
+ zope.component.interface.provideInterface(name, layer, IBrowserSkinType)
+ return True
+
+
+def determine_class_directive(directive_name, factory, module_info, default=None):
+ directive = util.class_annotation(factory, directive_name, None)
+ if directive is None:
+ directive = module_info.getAnnotation(directive_name, None)
+ if directive is not None:
+ return directive
+ else:
+ return default
+
Modified: grok/branches/ulif-i18n/src/grok/tests/event/subscriber.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/tests/event/subscriber.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/tests/event/subscriber.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -8,6 +8,12 @@
['Manfred']
>>> mammoths2
['Manfred']
+
+The decorated event handling function can also be called directly:
+
+ >>> mammothAdded(Mammoth('Max'),None)
+ >>> mammoths
+ ['Manfred', 'Max']
"""
import grok
Modified: grok/branches/ulif-i18n/src/grok/tests/form/form.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/tests/form/form.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/tests/form/form.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -1,32 +1,11 @@
"""
-A grok.Model may contain a nested class named 'fields'. All attributes of
-'fields' that provide IField will cause attributes of the same name to appear on
-the grok.Model:
-
- >>> grok.grok(__name__)
- >>> manfred = Mammoth()
- >>> print manfred.name
- None
- >>> print manfred.size
- Quite normal
- >>> manfred.somethingelse
- Traceback (most recent call last):
- ...
- AttributeError: 'Mammoth' object has no attribute 'somethingelse'
-
-If the 'fields' attribute is not an old-style class, it will not trigger any
-attribute generation:
-
- >>> cave = Cave()
- >>> cave.ignored
- Traceback (most recent call last):
- ...
- AttributeError: 'Cave' object has no attribute 'ignored'
-
A grok.EditForm is a special grok.View that renders an edit form.
>>> from zope import component
>>> from zope.publisher.browser import TestRequest
+ >>> grok.grok(__name__)
+ >>> manfred = Mammoth()
+
>>> request = TestRequest()
>>> view = component.getMultiAdapter((manfred, request), name='edit')
>>> len(view.form_fields)
@@ -46,24 +25,26 @@
"""
import grok
from zope import schema
+from zope.interface import Interface, implements
+class IMammoth(Interface):
+ name = schema.TextLine(title=u"Name")
+ size = schema.TextLine(title=u"Size", default=u"Quite normal")
+
class Mammoth(grok.Model):
- class fields:
- name = schema.TextLine(title=u"Name")
- size = schema.TextLine(title=u"Size", default=u"Quite normal")
- somethingelse = None
+ implements(IMammoth)
class Edit(grok.EditForm):
grok.context(Mammoth)
-class Cave(grok.Model):
- fields = ['ignored']
+class IDifferentMammoth(Interface):
+ # mind the different order of fields
+ size = schema.TextLine(title=u"Size", default=u"Quite normal")
+ name = schema.TextLine(title=u"Name")
class DifferentMammoth(grok.Model):
- class fields:
- # mind the different order of fields
- size = schema.TextLine(title=u"Size", default=u"Quite normal")
- name = schema.TextLine(title=u"Name")
+ implements(IDifferentMammoth)
class EditDifferent(grok.EditForm):
grok.context(DifferentMammoth)
+
Modified: grok/branches/ulif-i18n/src/grok/tests/form/schemaform.py
===================================================================
--- grok/branches/ulif-i18n/src/grok/tests/form/schemaform.py 2007-10-17 22:20:17 UTC (rev 80907)
+++ grok/branches/ulif-i18n/src/grok/tests/form/schemaform.py 2007-10-17 22:22:36 UTC (rev 80908)
@@ -3,6 +3,10 @@
>>> grok.grok(__name__)
>>> manfred = Mammoth()
+ >>> print manfred.name
+ None
+ >>> print manfred.size
+ Quite normal
A grok.EditForm is a special grok.View that renders an edit form.
@@ -23,15 +27,6 @@
>>> [w.__name__ for w in view.form_fields]
['can_talk', 'name', 'size']
-Schema fields and model level fields are combined:
-
- >>> view = component.getMultiAdapter(
- ... (AnotherMammoth(), request), name='edit3')
- >>> len(view.form_fields)
- 3
- >>> [w.__name__ for w in view.form_fields]
- ['can_talk', 'name', 'size']
-
If the context is an interface instead of a model directly, the fields
will be retrieved from that interface, and that interface only:
@@ -45,39 +40,44 @@
"""
import grok
from zope import interface, schema
+from zope.schema.fieldproperty import FieldProperty
class IMammoth(interface.Interface):
name = schema.TextLine(title=u"Name")
size = schema.TextLine(title=u"Size", default=u"Quite normal")
+
class Mammoth(grok.Model):
interface.implements(IMammoth)
+ name = FieldProperty(IMammoth['name'])
+ size = FieldProperty(IMammoth['size'])
+
+
class Edit(grok.EditForm):
grok.context(Mammoth)
+
class IMovieCharacter(interface.Interface):
can_talk = schema.Bool(title=u'Can talk', default=False)
+
class Manfred(Mammoth):
interface.implements(IMovieCharacter)
+
class Edit2(grok.EditForm):
grok.context(Manfred)
-class AnotherMammoth(Mammoth):
- class fields:
- can_talk = schema.Bool(title=u'Can talk', default=False)
-class Edit3(grok.EditForm):
- grok.context(AnotherMammoth)
-
class IYetAnotherMammoth(interface.Interface):
alpha = schema.TextLine(title=u'alpha')
beta = schema.TextLine(title=u'beta')
+
class YetAnotherMammoth(grok.Model):
interface.implements(IYetAnotherMammoth)
+
class Edit4(grok.EditForm):
grok.context(IYetAnotherMammoth)
Copied: grok/branches/ulif-i18n/versions.cfg (from rev 80896, grok/trunk/versions.cfg)
===================================================================
--- grok/branches/ulif-i18n/versions.cfg (rev 0)
+++ grok/branches/ulif-i18n/versions.cfg 2007-10-17 22:22:36 UTC (rev 80908)
@@ -0,0 +1,109 @@
+[versions]
+CPygments = 0.8.1
+RestrictedPython = 3.4.2
+ZConfig = 2.5
+ZODB3 = 3.8.0b2
+docutils = 0.4
+ClientForm = 0.2.7
+martian = 0.9
+mechanize = 0.1.7b
+pytz = 2007g
+setuptools = 0.6c7
+simplejson = 1.7.1
+z3c.flashmessage = 1.0b2
+# is this borked?
+zc.catalog = 1.2b
+zc.recipe.egg = 1.0.0b6
+zc.recipe.filestorage = 1.0a5
+zc.recipe.testrunner = 1.0.0b8
+zc.zope3recipes = 0.6b1
+zdaemon = 2.0.0
+zodbcode = 3.4.0b1dev-r75670
+zope.annotation = 3.4.0
+zope.app.apidoc = 3.4.0a1
+zope.app.applicationcontrol = 3.4.1
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.0a1
+zope.app.basicskin = 3.4.0a1
+zope.app.broken = 3.4.0a1
+zope.app.catalog = 3.4.0a2
+zope.app.component = 3.4.0b3
+zope.app.container = 3.5.0a1
+zope.app.content = 3.4.0a1
+zope.app.debug = 3.4.0a1
+zope.app.dependable = 3.4.0a1
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.0a1
+zope.app.file = 3.4.0a1
+zope.app.folder = 3.4.0a1
+zope.app.form = 3.4.0b2
+zope.app.generations = 3.4.0a1
+zope.app.http = 3.4.0a1
+zope.app.i18n = 3.4.0a1
+zope.app.interface = 3.4.0a1
+zope.app.intid = 3.4.0a2
+zope.app.keyreference = 3.4.0a1
+zope.app.locales = 3.4.0b1.dev-r77033
+zope.app.onlinehelp = 3.4.0a1
+zope.app.pagetemplate = 3.4.0
+zope.app.preference = 3.4.0a1
+zope.app.principalannotation = 3.4.0a1
+zope.app.publication = 3.4.2
+# is this borked?
+zope.app.publisher = 3.5.0a2
+zope.app.renderer = 3.4.0a1
+zope.app.rotterdam = 3.4.0a1
+zope.app.schema = 3.4.0a1
+zope.app.security = 3.4.0a1-1
+zope.app.securitypolicy = 3.4.0a1
+zope.app.server = 3.4.0b1dev-r75388
+zope.app.session = 3.4.0a1
+zope.app.skins = 3.4.0a1
+zope.app.testing = 3.4.0b1-r78707
+zope.app.tree = 3.4.0a1
+zope.app.twisted = 3.4.0b1-r76119
+zope.app.wsgi = 3.4.0
+zope.app.zapi = 3.4.0a1
+zope.app.zcmlfiles = 3.4.0a1
+zope.app.zopeappgenerations = 3.4.0a1
+zope.cachedescriptors = 3.4.0
+zope.component = 3.4.0
+zope.configuration = 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
+# is this borked?
+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.0b5.dev-r78840
+# we need to have a windows binary egg
+zope.i18nmessageid = 3.4.0a1
+zope.index = 3.4.1
+zope.interface = 3.4.0
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0b2
+zope.minmax = 1.0
+zope.modulealias = 3.4.0a1
+zope.pagetemplate = 3.4.0a1
+zope.proxy = 3.4.0
+zope.publisher = 3.5.0a1.dev-r78838
+zope.schema = 3.4.0
+zope.security = 3.4.0b5
+zope.server = 3.5.0a2
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.0b1
+zope.tales = 3.4.0a1
+zope.testbrowser = 3.4.1
+zope.testing = 3.5.1
+zope.thread = 3.4
+zope.traversing = 3.5.0a1.dev-r78730
More information about the Checkins
mailing list