[Checkins] SVN: zope.event/trunk/ Merge 'tseaver-new_style_docs' branch.
Tres Seaver
tseaver at palladion.com
Sat May 1 13:45:02 EDT 2010
Log message for revision 111849:
Merge 'tseaver-new_style_docs' branch.
Changed:
_U zope.event/trunk/
U zope.event/trunk/.bzrignore
U zope.event/trunk/CHANGES.txt
U zope.event/trunk/README.txt
U zope.event/trunk/buildout.cfg
A zope.event/trunk/docs/
U zope.event/trunk/docs/Makefile
U zope.event/trunk/docs/api.rst
U zope.event/trunk/docs/conf.py
U zope.event/trunk/docs/hacking.rst
U zope.event/trunk/docs/index.rst
U zope.event/trunk/docs/make.bat
U zope.event/trunk/docs/theory.rst
U zope.event/trunk/docs/usage.rst
U zope.event/trunk/setup.py
D zope.event/trunk/src/zope/event/README.txt
U zope.event/trunk/src/zope/event/__init__.py
U zope.event/trunk/src/zope/event/tests.py
-=-
Property changes on: zope.event/trunk
___________________________________________________________________
Added: svn:mergeinfo
+ /zope.event/branches/tseaver-new_style_docs:111183,111846-111848
Added: svk:merge
+ 62d5b8a3-27da-0310-9561-8e5933582275:/zope.event/branches/tseaver-new_style_docs:111848
Modified: zope.event/trunk/.bzrignore
===================================================================
--- zope.event/trunk/.bzrignore 2010-05-01 17:36:26 UTC (rev 111848)
+++ zope.event/trunk/.bzrignore 2010-05-01 17:45:01 UTC (rev 111849)
@@ -4,3 +4,4 @@
./develop-eggs
./parts
*.egg-info
+./docs/_build/*
Modified: zope.event/trunk/CHANGES.txt
===================================================================
--- zope.event/trunk/CHANGES.txt 2010-05-01 17:36:26 UTC (rev 111848)
+++ zope.event/trunk/CHANGES.txt 2010-05-01 17:45:01 UTC (rev 111849)
@@ -1,10 +1,15 @@
-CHANGES
-=======
+``zope.event`` Changelog
+========================
+3.5.1 (unreleased)
+------------------
+
+- Added Sphinx documentation.
+
3.5.0 (2010-05-01)
------------------
-- Added change log to ``long_description``.
+- Added change log to ``long-description``.
- Support for Python 3.x.
Modified: zope.event/trunk/README.txt
===================================================================
--- zope.event/trunk/README.txt 2010-05-01 17:36:26 UTC (rev 111848)
+++ zope.event/trunk/README.txt 2010-05-01 17:45:01 UTC (rev 111849)
@@ -1,12 +1,14 @@
-**********
-zope.event
-**********
+``zope.event`` README
+=====================
-The ``zope.event`` package provides a simple event system. It provides:
+The ``zope.event`` package provides a simple event system, including:
-- An event publishing system
+- An event publishing API, intended for use by applications which are
+ unaware of any subscribers to their events.
- A very simple event-dispatching system on which more sophisticated
event dispatching systems can be built. For example, a type-based
event dispatching system that builds on ``zope.event`` can be found in
``zope.component``.
+
+Please see ``doc/index.rst`` for the documentation.
Modified: zope.event/trunk/buildout.cfg
===================================================================
--- zope.event/trunk/buildout.cfg 2010-05-01 17:36:26 UTC (rev 111848)
+++ zope.event/trunk/buildout.cfg 2010-05-01 17:45:01 UTC (rev 111849)
@@ -1,7 +1,15 @@
[buildout]
-parts = test
develop = .
+parts =
+ test
+ sphinx
[test]
recipe = zc.recipe.testrunner
eggs = zope.event
+
+[sphinx]
+recipe = zc.recipe.egg
+eggs =
+ Sphinx
+ zope.event
Modified: zope.event/trunk/setup.py
===================================================================
--- zope.event/trunk/setup.py 2010-05-01 17:36:26 UTC (rev 111848)
+++ zope.event/trunk/setup.py 2010-05-01 17:45:01 UTC (rev 111849)
@@ -30,7 +30,7 @@
# Python 3 support:
extra = dict(
use_2to3=True,
- convert_2to3_doctests=['src/zope/event/README.txt'],
+ convert_2to3_doctests=['docs/index.rst'],
)
def read(*rnames):
@@ -46,8 +46,6 @@
author_email='zope-dev at zope.org',
long_description=(
read('README.txt')
- + '\n\n.. contents::\n\n' +
- read('src', 'zope', 'event', 'README.txt')
+ '\n' +
read('CHANGES.txt')
),
Deleted: zope.event/trunk/src/zope/event/README.txt
===================================================================
--- zope.event/trunk/src/zope/event/README.txt 2010-05-01 17:36:26 UTC (rev 111848)
+++ zope.event/trunk/src/zope/event/README.txt 2010-05-01 17:45:01 UTC (rev 111849)
@@ -1,73 +0,0 @@
-Events
-======
-
-This package provides a simple event system on which
-application-specific event systems can be built.
-
-Application code can generate events without being concerned about the
-event-processing frameworks that might handle the events.
-
-Events are objects that represent something happening in a system.
-They are used to extend processing by providing processing plug
-points.
-
-The package has a list of subscribers. Application code can manage
-subscriptions by manipulating this list. For the examples here, we'll
-save the current contents away and empty the list. We'll restore the
-contents when we're done with our examples.
-
- >>> import zope.event
- >>> old_subscribers = zope.event.subscribers[:]
- >>> del zope.event.subscribers[:]
-
-The package provides a `notify` function, which is used to
-notify subscribers that something has happened:
-
- >>> class MyEvent:
- ... pass
-
- >>> event = MyEvent()
- >>> zope.event.notify(event)
-
-The notify function is called with a single object, which we call an
-event. Any object will do:
-
- >>> zope.event.notify(None)
- >>> zope.event.notify(42)
-
-An extremely trivial subscription mechanism is provided. Subscribers
-are simply callback functions:
-
- >>> def f(event):
- ... print 'got:', event
-
-that are put into the subscriptions list:
-
- >>> zope.event.subscribers.append(f)
-
- >>> zope.event.notify(42)
- got: 42
-
- >>> def g(event):
- ... print 'also got:', event
-
- >>> zope.event.subscribers.append(g)
-
- >>> zope.event.notify(42)
- got: 42
- also got: 42
-
-To unsubscribe, simply remove a subscriber from the list:
-
- >>> zope.event.subscribers.remove(f)
- >>> zope.event.notify(42)
- also got: 42
-
-Generally, application frameworks will provide more sophisticated
-subscription mechanisms that build on this simple mechanism. The
-frameworks will install subscribers that then dispatch to other
-subscribers based on event types or data.
-
-We're done, so we'll restore the subscribers:
-
- >>> zope.event.subscribers[:] = old_subscribers
Modified: zope.event/trunk/src/zope/event/__init__.py
===================================================================
--- zope.event/trunk/src/zope/event/__init__.py 2010-05-01 17:36:26 UTC (rev 111848)
+++ zope.event/trunk/src/zope/event/__init__.py 2010-05-01 17:45:01 UTC (rev 111849)
@@ -11,13 +11,21 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""base event system implementation
+""" Base event system implementation
-$Id$
"""
+#: Applications may register for notification of events by appending a
+#: callable to the ``subscribers`` list.
+#:
+#: Each subscriber takes a single argument, which is the event object
+#: being published.
+#:
+#: Exceptions raised by subscribers will be propagated.
subscribers = []
def notify(event):
+ """ Notify all subscribers of ``event``.
+ """
for subscriber in subscribers:
subscriber(event)
Modified: zope.event/trunk/src/zope/event/tests.py
===================================================================
--- zope.event/trunk/src/zope/event/tests.py 2010-05-01 17:36:26 UTC (rev 111848)
+++ zope.event/trunk/src/zope/event/tests.py 2010-05-01 17:45:01 UTC (rev 111849)
@@ -14,7 +14,6 @@
""" Test the event system
"""
import unittest
-import doctest
class Test_notify(unittest.TestCase):
@@ -46,5 +45,4 @@
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(Test_notify),
- doctest.DocFileSuite('README.txt'),
))
More information about the checkins
mailing list