[Checkins] SVN: grokcore.site/trunk/ Update code documentation, use Grok 1.0b2 versions.cfg to run test against.
Sylvain Viollon
sylvain at infrae.com
Fri Sep 18 06:17:12 EDT 2009
Log message for revision 104285:
Update code documentation, use Grok 1.0b2 versions.cfg to run test against.
Changed:
U grokcore.site/trunk/CHANGES.txt
U grokcore.site/trunk/buildout.cfg
U grokcore.site/trunk/setup.py
U grokcore.site/trunk/src/grokcore/site/components.py
U grokcore.site/trunk/src/grokcore/site/directive.py
U grokcore.site/trunk/src/grokcore/site/subscriber.py
D grokcore.site/trunk/versions.cfg
-=-
Modified: grokcore.site/trunk/CHANGES.txt
===================================================================
--- grokcore.site/trunk/CHANGES.txt 2009-09-18 10:16:00 UTC (rev 104284)
+++ grokcore.site/trunk/CHANGES.txt 2009-09-18 10:17:12 UTC (rev 104285)
@@ -1,11 +1,16 @@
Changes
=======
-1.1 (unreleased)
-----------------
+1.0.2 (unreleased)
+------------------
-* Bring versions.cfg in line with grok current versions.cfg.
+* Update code documentation from Grok itself.
+* Use 1.0b2 versions.cfg in Grok's release info instead of a local
+ copy; a local copy for all grokcore packages is just too hard to
+ maintain.
+
+
1.0.1 (2009-06-30)
------------------
Modified: grokcore.site/trunk/buildout.cfg
===================================================================
--- grokcore.site/trunk/buildout.cfg 2009-09-18 10:16:00 UTC (rev 104284)
+++ grokcore.site/trunk/buildout.cfg 2009-09-18 10:17:12 UTC (rev 104285)
@@ -1,14 +1,12 @@
[buildout]
develop = .
parts = interpreter test
-extends = versions.cfg
+extends = http://grok.zope.org/releaseinfo/grok-1.0b2.cfg
versions = versions
-
[versions]
grokcore.site =
-
[interpreter]
recipe = zc.recipe.egg
eggs = grokcore.site
Modified: grokcore.site/trunk/setup.py
===================================================================
--- grokcore.site/trunk/setup.py 2009-09-18 10:16:00 UTC (rev 104284)
+++ grokcore.site/trunk/setup.py 2009-09-18 10:17:12 UTC (rev 104285)
@@ -12,7 +12,7 @@
setup(
name='grokcore.site',
- version='1.1dev',
+ version='1.0.2dev',
author='Grok Team',
author_email='grok-dev at zope.org',
url='http://grok.zope.org',
Modified: grokcore.site/trunk/src/grokcore/site/components.py
===================================================================
--- grokcore.site/trunk/src/grokcore/site/components.py 2009-09-18 10:16:00 UTC (rev 104284)
+++ grokcore.site/trunk/src/grokcore/site/components.py 2009-09-18 10:17:12 UTC (rev 104285)
@@ -35,9 +35,10 @@
"""Mixin for creating sites in Grok applications.
When an application `grok.Model` or `grok.Container` also inherits
- from `grok.Site`, then it can additionally support the registration
- of local Component Architecture entities like `grok.LocalUtility`
- and `grok.Indexes` objects; see those classes for more information.
+ from `grokcore.site.Site`, then it can additionally support the
+ registration of local Component Architecture entities like
+ `grokcore.site.LocalUtility` and `grok.Indexes` objects; see those
+ classes for more information.
"""
@@ -46,17 +47,18 @@
"""The base class for local utilities in Grok applications.
Although application developers can create local utilies without
- actually subclassing `grok.LocalUtility`, they gain three benefits
- from doing so. First, their code is more readable because their
- classes "look like" local utilities to casual readers. Second,
- their utility will know how to persist itself to the Zope database,
- which means that they can set its object attributes and know that
- the values are getting automatically saved. Third, they can omit
- the `grok.provides()` directive naming the interface that the
- utility provides, if their class only `grok.implements()` a single
- interface (unless the interface is one that the `grok.LocalUtility`
- already implements, in which case Grok cannot tell them apart, and
- `grok.provides()` must be used explicitly anyway).
+ actually subclassing `grokcore.site.LocalUtility`, they gain three
+ benefits from doing so. First, their code is more readable
+ because their classes "look like" local utilities to casual
+ readers. Second, their utility will know how to persist itself to
+ the Zope database, which means that they can set its object
+ attributes and know that the values are getting automatically
+ saved. Third, they can omit the `grok.provides()` directive
+ naming the interface that the utility provides, if their class
+ only `grok.implements()` a single interface (unless the interface
+ is one that the `grok.LocalUtility` already implements, in which
+ case Grok cannot tell them apart, and `grok.provides()` must be
+ used explicitly anyway).
"""
implements(IContext)
Modified: grokcore.site/trunk/src/grokcore/site/directive.py
===================================================================
--- grokcore.site/trunk/src/grokcore/site/directive.py 2009-09-18 10:16:00 UTC (rev 104284)
+++ grokcore.site/trunk/src/grokcore/site/directive.py 2009-09-18 10:17:12 UTC (rev 104285)
@@ -26,6 +26,39 @@
from martian.error import GrokImportError
class local_utility(martian.Directive):
+ """The `grokcore.site.local_utility()` directive.
+
+ Place this directive inside of a `grokcore.site.Site` subclass,
+ and provide the name of a utility you want activated inside of
+ that site::
+
+ class MySite(grokcore.site.Site):
+ grok.local_utility(MyMammothUtility)
+ ...
+
+ This directive can be supplied several times within the same site.
+ Thanks to the presence of this directive, any time an instance of
+ your class is created in the Zope database it will have a copy of
+ the given local utility installed along with it.
+
+ This directive accepts several normal Component-registration keyword
+ arguments, like `provides` and `name`, and uses them each time it
+ registers your local utility.
+
+ If you do not supply a `provides` keyword, then Grok attempts to
+ guess a sensible default. Its first choice is to use any
+ interface(s) that you listed with the grok.provides() directive
+ when defining your utility. Otherwise, if your utility is a
+ subclass of `grokcore.site.LocalUtility`, then Grok will use any
+ interfaces that your utility supplies beyond those are supplied
+ because of its inheritance from `grokcore.site.LocalUtility`.
+ Else, as a final fallback, it checks to see whether the class you
+ are registering supplies one, and only one, interface; if so, then
+ it can register the utility unambiguously as providing that one
+ interface.
+
+ """
+
scope = martian.CLASS
store = martian.DICT
@@ -74,13 +107,14 @@
class LocalUtilityInfo(object):
"""The information about how to register a local utility.
- An instance of this class is created for each `grok.local_utility()`
- in a Grok application's code, to remember how the user wants their
- local utility registered. Later, whenever the application creates
- new instances of the site or application for which the local utility
- directive was supplied, this block of information is used as the
- parameters to the creation of the local utility which is created
- along with the new site in the Zope database.
+ An instance of this class is created for each
+ `grokcore.site.local_utility()` in a Grok application's code, to
+ remember how the user wants their local utility registered.
+ Later, whenever the application creates new instances of the site
+ or application for which the local utility directive was supplied,
+ this block of information is used as the parameters to the
+ creation of the local utility which is created along with the new
+ site in the Zope database.
"""
_order = 0
Modified: grokcore.site/trunk/src/grokcore/site/subscriber.py
===================================================================
--- grokcore.site/trunk/src/grokcore/site/subscriber.py 2009-09-18 10:16:00 UTC (rev 104284)
+++ grokcore.site/trunk/src/grokcore/site/subscriber.py 2009-09-18 10:17:12 UTC (rev 104285)
@@ -23,8 +23,8 @@
"""Add a local site manager to a Grok site object upon its creation.
Grok registers this function so that it gets called each time a
- `grok.Site` instance is added to a container. It creates a local
- site manager and installs it on the newly created site.
+ `grokcore.site.Site` instance is added to a container. It creates
+ a local site manager and installs it on the newly created site.
"""
Deleted: grokcore.site/trunk/versions.cfg
===================================================================
--- grokcore.site/trunk/versions.cfg 2009-09-18 10:16:00 UTC (rev 104284)
+++ grokcore.site/trunk/versions.cfg 2009-09-18 10:17:12 UTC (rev 104285)
@@ -1,115 +0,0 @@
-# This is a copy of grok/versions.cfg revision 102959.
-#
-# Don't make local modifications here, just override it explicitly in
-# your buildout's [versions] part.
-
-[versions]
-ClientForm = 0.2.9
-grokcore.component = 1.7
-grokcore.formlib = 1.2
-grokcore.security = 1.1
-grokcore.view = 1.9
-grokcore.viewlet = 1.1
-grokui.admin = 0.3.2
-martian = 0.11
-mechanize = 0.1.7b
-pytz = 2007k
-RestrictedPython = 3.4.2
-simplejson = 1.7.1
-z3c.autoinclude = 0.2.2
-z3c.flashmessage = 1.0
-z3c.testsetup = 0.4
-zc.catalog = 1.2.0
-ZConfig = 2.5.1
-zc.recipe.testrunner = 1.0.0
-zdaemon = 2.0.2
-ZODB3 = 3.8.2
-zodbcode = 3.4.0
-zope.annotation = 3.4.1
-zope.app.apidoc = 3.4.3
-zope.app.applicationcontrol = 3.4.3
-zope.app.appsetup = 3.4.1
-zope.app.authentication = 3.4.4
-zope.app.basicskin = 3.4.0
-zope.app.broken = 3.4.0
-zope.app.catalog = 3.5.1
-zope.app.component = 3.4.1
-zope.app.container = 3.5.6
-zope.app.content = 3.4.0
-zope.app.debug = 3.4.1
-zope.app.dependable = 3.4.0
-zope.app.error = 3.5.1
-zope.app.exception = 3.4.1
-zope.app.file = 3.4.4
-zope.app.folder = 3.4.0
-zope.app.form = 3.4.1
-zope.app.generations = 3.4.1
-zope.app.http = 3.4.1
-zope.app.i18n = 3.4.4
-zope.app.interface = 3.4.0
-zope.app.intid = 3.4.1
-zope.app.keyreference = 3.4.1
-zope.app.locales = 3.4.5
-zope.app.onlinehelp = 3.4.1
-zope.app.pagetemplate = 3.4.1
-zope.app.preference = 3.4.1
-zope.app.principalannotation = 3.4.0
-zope.app.publication = 3.4.3
-zope.app.publisher = 3.5.1
-zope.app.renderer = 3.4.0
-zope.app.rotterdam = 3.4.1
-zope.app.schema = 3.4.0
-zope.app.security = 3.5.2
-zope.app.securitypolicy = 3.4.6
-zope.app.server = 3.4.2
-zope.app.session = 3.5.1
-zope.app.skins = 3.4.0
-zope.app.testing = 3.4.3
-zope.app.tree = 3.4.0
-zope.app.twisted = 3.4.1
-zope.app.wsgi = 3.4.1
-zope.app.zapi = 3.4.0
-zope.app.zcmlfiles = 3.4.3
-zope.app.zopeappgenerations = 3.4.0
-zope.cachedescriptors = 3.4.1
-zope.component = 3.4.0
-zope.configuration = 3.4.0
-zope.contentprovider = 3.4.0
-zope.contenttype = 3.4.0
-zope.copypastemove = 3.4.0
-zope.datetime = 3.4.0
-zope.deferredimport = 3.4.0
-zope.deprecation = 3.4.0
-zope.dottedname = 3.4.2
-zope.dublincore = 3.4.0
-zope.error = 3.5.1
-zope.event = 3.4.0
-zope.exceptions = 3.4.0
-zope.filerepresentation = 3.4.0
-zope.formlib = 3.4.0
-zope.hookable = 3.4.0
-zope.i18n = 3.4.0
-zope.i18nmessageid = 3.4.3
-zope.index = 3.4.1
-zope.interface = 3.4.1
-zope.lifecycleevent = 3.4.0
-zope.location = 3.4.0
-zope.minmax = 1.1.0
-zope.modulealias = 3.4.0
-zope.pagetemplate = 3.4.0
-zope.proxy = 3.4.2
-zope.publisher = 3.4.9
-zope.schema = 3.4.0
-zope.security = 3.4.1
-zope.securitypolicy = 3.4.1
-zope.server = 3.4.3
-zope.session = 3.4.1
-zope.size = 3.4.0
-zope.structuredtext = 3.4.0
-zope.tal = 3.4.1
-zope.tales = 3.4.0
-zope.testbrowser = 3.4.2
-zope.testing = 3.7.6
-zope.thread = 3.4
-zope.traversing = 3.4.1
-zope.viewlet = 3.4.2
More information about the checkins
mailing list