[Checkins] SVN: zope.browser/trunk/ Move ``IView`` and ``IBrowserView`` interfaces here from
Tres Seaver
tseaver at palladion.com
Wed May 13 16:52:19 EDT 2009
Log message for revision 99919:
Move ``IView`` and ``IBrowserView`` interfaces here from
``zope.publisher.interfaces`` to break undesirable dependencies.
Changed:
_U zope.browser/trunk/
U zope.browser/trunk/CHANGES.txt
U zope.browser/trunk/README.txt
U zope.browser/trunk/setup.py
U zope.browser/trunk/src/zope/browser/README.txt
U zope.browser/trunk/src/zope/browser/interfaces.py
-=-
Property changes on: zope.browser/trunk
___________________________________________________________________
Modified: svn:ignore
- .installed.cfg
bin
develop-eggs
parts
+ .installed.cfg
bin
develop-eggs
eggs
parts
Modified: zope.browser/trunk/CHANGES.txt
===================================================================
--- zope.browser/trunk/CHANGES.txt 2009-05-13 20:41:24 UTC (rev 99918)
+++ zope.browser/trunk/CHANGES.txt 2009-05-13 20:52:19 UTC (rev 99919)
@@ -1,8 +1,14 @@
-=======
-CHANGES
-=======
+zope.browser Changelog
+======================
+1.0 (unreleased)
+----------------
+
+- Moved ``IView`` and ``IBrowserView`` interfaces here from
+ ``zope.publisher.interfaces`` to break undesirable dependencies.
+
0.5.0 (2008-12-11)
------------------
-- Initial release
+- Moved ``ITerms`` interface here from ``zope.app.form.browser.interfaces``
+ to break undesirable dependencies.
Modified: zope.browser/trunk/README.txt
===================================================================
--- zope.browser/trunk/README.txt 2009-05-13 20:41:24 UTC (rev 99918)
+++ zope.browser/trunk/README.txt 2009-05-13 20:52:19 UTC (rev 99919)
@@ -1 +1,6 @@
-This package provides shared zope browser components without other dependencies.
+zope.browesr README
+===================
+
+This package provides shared browser components for the Zope Toolkit.
+
+Please see ``src/zope/browser/README.txt`` for details.
Modified: zope.browser/trunk/setup.py
===================================================================
--- zope.browser/trunk/setup.py 2009-05-13 20:41:24 UTC (rev 99918)
+++ zope.browser/trunk/setup.py 2009-05-13 20:52:19 UTC (rev 99919)
@@ -24,7 +24,7 @@
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(name='zope.browser',
- version = '0.5.0',
+ version = '1.0dev',
author='Zope Corporation and Contributors',
author_email='zope3-dev at zope.org',
description='Shared dependency less Zope 3 browser components',
Modified: zope.browser/trunk/src/zope/browser/README.txt
===================================================================
--- zope.browser/trunk/src/zope/browser/README.txt 2009-05-13 20:41:24 UTC (rev 99918)
+++ zope.browser/trunk/src/zope/browser/README.txt 2009-05-13 20:52:19 UTC (rev 99919)
@@ -1,23 +1,54 @@
-======
-README
-======
+IView
+-----
-This package provides shared browser components for Zope 3.
+Views adapt both a context and a request.
+There is not much we can test except that ``IView`` is importable
+and an interface:
+.. doctest::
+
+ >>> from zope.interface import Interface
+ >>> from zope.browser.interfaces import IView
+ >>> Interface.providedBy(IView)
+ True
+
+IBrowserView
+-------------
+
+Browser views are views specialized for requests from a browser (e.g.,
+as distinct from WebDAV, FTP, XML-RPC, etc.).
+
+There is not much we can test except that ``IBrowserView`` is importable
+and an interface derived from ``IView``:
+
+.. doctest::
+
+ >>> from zope.interface import Interface
+ >>> from zope.browser.interfaces import IBrowserView
+ >>> Interface.providedBy(IBrowserView)
+ True
+ >>> IBrowserView.extends(IView)
+ True
+
ITerms
------
-The ITerms interface is used as a base for ISource widget implementations. This
-interfaces get used by zope.app.form and was initially defined in
-zope.app.form.browser.interfaces.py. This makes it impossible to use for other
-packages like z3c.form wihtout to depend on zope.app.form. Moving such base
-components or interfaces to zope.browser will make it possible to share such
-base components.
+The ``ITerms`` interface is used as a base for ``ISource`` widget
+implementations. This interfaces get used by ``zope.app.form`` and was
+initially defined in ``zope.app.form.browser.interfaces``, which made it
+impossible to use for other packages like ``z3c.form`` wihtout depending on
+``zope.app.form``.
-There is not much we can test except that ITerms is importable and an interface:
+Moving such base components / interfaces to ``zope.browser`` makes it
+possible to share them without undesirable dependencies.
- >>> import zope.interface
- >>> from zope.browser import interfaces
- >>> zope.interface.Interface.providedBy(interfaces.ITerms)
+There is not much we can test except that ITerms is importable
+and an interface:
+
+.. doctest::
+
+ >>> from zope.interface import Interface
+ >>> from zope.browser.interfaces import ITerms
+ >>> Interface.providedBy(ITerms)
True
Modified: zope.browser/trunk/src/zope/browser/interfaces.py
===================================================================
--- zope.browser/trunk/src/zope/browser/interfaces.py 2009-05-13 20:41:24 UTC (rev 99918)
+++ zope.browser/trunk/src/zope/browser/interfaces.py 2009-05-13 20:52:19 UTC (rev 99919)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2004 Zope Corporation and Contributors.
+# Copyright (c) 2004-2009 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -12,17 +12,28 @@
#
##############################################################################
"""Shared dependency less Zope3 brwoser components.
-
-$Id:$
"""
+__docformat__ = 'restructuredtext'
-import zope.interface
+from zope.interface import Attribute
+from zope.interface import Interface
-__docformat__ = 'restructuredtext'
+class IView(Interface):
+ """ Views are multi-adapters for context and request objects.
+ """
+ context = Attribute("The context object the view renders")
+ request = Attribute("The request object driving the view")
+class IBrowserView(IView):
+ """ Views which are specialized for requests from a browser
+
+ o Such views are distinct from those geerated via WebDAV, FTP, XML-RPC,
+ etc..
+ """
-class ITerms(zope.interface.Interface):
-
+class ITerms(Interface):
+ """ Adapter providing lookups for vocabulary terms.
+ """
def getTerm(value):
"""Return an ITitledTokenizedTerm object for the given value
More information about the Checkins
mailing list