zope.event-4.0.1/0000775000175000017500000000000012053172013013511 5ustar tseavertseaverzope.event-4.0.1/setup.cfg0000664000175000017500000000037512053172013015337 0ustar tseavertseaver[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 [nosetests] cover-package = zope.event nocapture = 1 cover-erase = 1 with-doctest = 0 where = src [aliases] dev = develop easy_install zope.event[testing] docs = easy_install zope.event[docs] zope.event-4.0.1/buildout.cfg0000664000175000017500000000030112053170776016031 0ustar tseavertseaver[buildout] develop = . parts = test sphinx [test] recipe = zc.recipe.testrunner eggs = zope.event [sphinx] recipe = zc.recipe.egg eggs = zope.event[docs] dependent-scripts = true zope.event-4.0.1/PKG-INFO0000664000175000017500000000574712053172013014623 0ustar tseavertseaverMetadata-Version: 1.0 Name: zope.event Version: 4.0.1 Summary: Very basic event publishing system Home-page: http://pypi.python.org/pypi/zope.event Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: ``zope.event`` README ===================== The ``zope.event`` package provides a simple event system, including: - 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 http://docs.zope.org/zope.event/ for the documentation. ``zope.event`` Changelog ======================== 4.0.1 (2012-11-21) ------------------ - Added support for Python 3.3. 4.0.0 (2012-05-16) ------------------ - Automated build of Sphinx HTML docs and running doctest snippets via tox. - Dropped explicit support for Python 2.4 / 2.5 / 3.1. - Added support for PyPy. 3.5.2 (2012-03-30) ------------------ - This release is the last which will maintain support for Python 2.4 / Python 2.5. - Added support for continuous integration using ``tox`` and ``jenkins``. - Added 'setup.py dev' alias (runs ``setup.py develop`` plus installs ``nose`` and ``coverage``). - Added 'setup.py docs' alias (installs ``Sphinx`` and dependencies). 3.5.1 (2011-08-04) ------------------ - Added Sphinx documentation. 3.5.0 (2010-05-01) ------------------ - Added change log to ``long-description``. - Support for Python 3.x. 3.4.1 (2009-03-03) ------------------ - A few minor cleanups. 3.4.0 (2007-07-14) ------------------ - Initial release as a separate project. Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries :: Python Modules zope.event-4.0.1/tox.ini0000664000175000017500000000133712053171036015034 0ustar tseavertseaver[tox] envlist = # Jython support pending 2.7 support, due 2012-07-15 or so. See: # http://fwierzbicki.blogspot.com/2012/03/adconion-to-fund-jython-27.html # py26,py27,py32,pypy,jython,coverage py26,py27,py32,py33,pypy,coverage,docs [testenv] commands = python setup.py test -q deps = zope.event [testenv:jython] commands = jython setup.py test -q [testenv:coverage] basepython = python2.6 commands = nosetests --with-xunit --with-xcoverage deps = nose coverage nosexcover [testenv:docs] basepython = python2.6 commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest deps = Sphinx zope.event-4.0.1/setup.py0000664000175000017500000000476412053171577015254 0ustar tseavertseaver############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## # This package is developed by the Zope Toolkit project, documented here: # http://docs.zope.org/zopetoolkit # When developing and releasing this package, please follow the documented # Zope Toolkit policies as described by this documentation. ############################################################################## """Setup for zope.event package """ import os from setuptools import setup, find_packages def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() setup( name='zope.event', version='4.0.1', url='http://pypi.python.org/pypi/zope.event', license='ZPL 2.1', description='Very basic event publishing system', author='Zope Foundation and Contributors', author_email='zope-dev@zope.org', long_description=( read('README.txt') + '\n' + read('CHANGES.txt') ), classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", ], packages=find_packages('src'), package_dir={'': 'src'}, namespace_packages=['zope',], include_package_data=True, install_requires=['setuptools'], zip_safe=False, test_suite='zope.event.tests.test_suite', extras_require={'docs': ['Sphinx'], 'testing': ['nose', 'coverage'], }, ) zope.event-4.0.1/bootstrap.py0000664000175000017500000000413712053170776016123 0ustar tseavertseaver############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Bootstrap a buildout-based project Simply run this script in a directory containing a buildout.cfg. The script accepts buildout command-line options, so you can use the -c option to specify an alternate configuration file. """ import os, shutil, sys, tempfile, urllib2 tmpeggs = tempfile.mkdtemp() ez = {} exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' ).read() in ez ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) import pkg_resources cmd = 'from setuptools.command.easy_install import main; main()' if sys.platform == 'win32': cmd = '"%s"' % cmd # work around spawn lamosity on windows ws = pkg_resources.working_set is_jython = sys.platform.startswith('java') if is_jython: import subprocess assert subprocess.Popen([sys.executable] + ['-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout'], env = dict(os.environ, PYTHONPATH= ws.find(pkg_resources.Requirement.parse('setuptools')).location ), ).wait() == 0 else: assert os.spawnle( os.P_WAIT, sys.executable, sys.executable, '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', dict(os.environ, PYTHONPATH= ws.find(pkg_resources.Requirement.parse('setuptools')).location ), ) == 0 ws.add_entry(tmpeggs) ws.require('zc.buildout') import zc.buildout.buildout zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) shutil.rmtree(tmpeggs) zope.event-4.0.1/.bzrignore0000664000175000017500000000021412053170776015526 0ustar tseavertseaver./.installed.cfg ./bin ./eggs ./develop-eggs ./parts *.egg-info ./docs/_build/* .coverage build __pycache__ .tox nosetests.xml coverage.xml zope.event-4.0.1/src/0000775000175000017500000000000012053172013014300 5ustar tseavertseaverzope.event-4.0.1/src/zope.event.egg-info/0000775000175000017500000000000012053172013020067 5ustar tseavertseaverzope.event-4.0.1/src/zope.event.egg-info/top_level.txt0000664000175000017500000000000512053172013022614 0ustar tseavertseaverzope zope.event-4.0.1/src/zope.event.egg-info/SOURCES.txt0000664000175000017500000000107612053172013021757 0ustar tseavertseaver.bzrignore CHANGES.txt COPYRIGHT.txt LICENSE.txt README.txt bootstrap.py buildout.cfg setup.cfg setup.py tox.ini docs/Makefile docs/api.rst docs/conf.py docs/hacking.rst docs/index.rst docs/make.bat docs/theory.rst docs/usage.rst src/zope/__init__.py src/zope.event.egg-info/PKG-INFO src/zope.event.egg-info/SOURCES.txt src/zope.event.egg-info/dependency_links.txt src/zope.event.egg-info/namespace_packages.txt src/zope.event.egg-info/not-zip-safe src/zope.event.egg-info/requires.txt src/zope.event.egg-info/top_level.txt src/zope/event/__init__.py src/zope/event/tests.pyzope.event-4.0.1/src/zope.event.egg-info/PKG-INFO0000664000175000017500000000574712053172013021201 0ustar tseavertseaverMetadata-Version: 1.0 Name: zope.event Version: 4.0.1 Summary: Very basic event publishing system Home-page: http://pypi.python.org/pypi/zope.event Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: ``zope.event`` README ===================== The ``zope.event`` package provides a simple event system, including: - 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 http://docs.zope.org/zope.event/ for the documentation. ``zope.event`` Changelog ======================== 4.0.1 (2012-11-21) ------------------ - Added support for Python 3.3. 4.0.0 (2012-05-16) ------------------ - Automated build of Sphinx HTML docs and running doctest snippets via tox. - Dropped explicit support for Python 2.4 / 2.5 / 3.1. - Added support for PyPy. 3.5.2 (2012-03-30) ------------------ - This release is the last which will maintain support for Python 2.4 / Python 2.5. - Added support for continuous integration using ``tox`` and ``jenkins``. - Added 'setup.py dev' alias (runs ``setup.py develop`` plus installs ``nose`` and ``coverage``). - Added 'setup.py docs' alias (installs ``Sphinx`` and dependencies). 3.5.1 (2011-08-04) ------------------ - Added Sphinx documentation. 3.5.0 (2010-05-01) ------------------ - Added change log to ``long-description``. - Support for Python 3.x. 3.4.1 (2009-03-03) ------------------ - A few minor cleanups. 3.4.0 (2007-07-14) ------------------ - Initial release as a separate project. Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries :: Python Modules zope.event-4.0.1/src/zope.event.egg-info/dependency_links.txt0000664000175000017500000000000112053172013024135 0ustar tseavertseaver zope.event-4.0.1/src/zope.event.egg-info/not-zip-safe0000664000175000017500000000000112053171013022314 0ustar tseavertseaver zope.event-4.0.1/src/zope.event.egg-info/namespace_packages.txt0000664000175000017500000000000512053172013024415 0ustar tseavertseaverzope zope.event-4.0.1/src/zope.event.egg-info/requires.txt0000664000175000017500000000006212053172013022465 0ustar tseavertseaversetuptools [docs] Sphinx [testing] nose coveragezope.event-4.0.1/src/zope/0000775000175000017500000000000012053172013015255 5ustar tseavertseaverzope.event-4.0.1/src/zope/__init__.py0000664000175000017500000000007012053170776017401 0ustar tseavertseaver__import__('pkg_resources').declare_namespace(__name__) zope.event-4.0.1/src/zope/event/0000775000175000017500000000000012053172013016376 5ustar tseavertseaverzope.event-4.0.1/src/zope/event/__init__.py0000664000175000017500000000210712053170776020525 0ustar tseavertseaver############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ Base event system implementation """ #: 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) zope.event-4.0.1/src/zope/event/tests.py0000664000175000017500000000271112053170776020131 0ustar tseavertseaver############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ Test the event system """ import unittest class Test_notify(unittest.TestCase): def setUp(self): from zope.event import subscribers self._old_subscribers = subscribers[:] subscribers[:] = [] def tearDown(self): from zope.event import subscribers subscribers[:] = self._old_subscribers def _callFUT(self, event): from zope.event import notify notify(event) def test_empty(self): event = object() self._callFUT(event) def test_not_empty(self): from zope.event import subscribers dummy = [] subscribers.append(dummy.append) event = object() self._callFUT(event) self.assertEqual(dummy, [event]) def test_suite(): return unittest.TestSuite(( unittest.makeSuite(Test_notify), )) zope.event-4.0.1/README.txt0000664000175000017500000000102512053170776015223 0ustar tseavertseaver``zope.event`` README ===================== The ``zope.event`` package provides a simple event system, including: - 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 http://docs.zope.org/zope.event/ for the documentation. zope.event-4.0.1/COPYRIGHT.txt0000664000175000017500000000004012053170776015632 0ustar tseavertseaverZope Foundation and Contributorszope.event-4.0.1/LICENSE.txt0000664000175000017500000000402612053170776015354 0ustar tseavertseaverZope Public License (ZPL) Version 2.1 A copyright notice accompanies this license document that identifies the copyright holders. This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders. 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders. 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. Disclaimer THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. zope.event-4.0.1/CHANGES.txt0000664000175000017500000000177712053171560015344 0ustar tseavertseaver``zope.event`` Changelog ======================== 4.0.1 (2012-11-21) ------------------ - Added support for Python 3.3. 4.0.0 (2012-05-16) ------------------ - Automated build of Sphinx HTML docs and running doctest snippets via tox. - Dropped explicit support for Python 2.4 / 2.5 / 3.1. - Added support for PyPy. 3.5.2 (2012-03-30) ------------------ - This release is the last which will maintain support for Python 2.4 / Python 2.5. - Added support for continuous integration using ``tox`` and ``jenkins``. - Added 'setup.py dev' alias (runs ``setup.py develop`` plus installs ``nose`` and ``coverage``). - Added 'setup.py docs' alias (installs ``Sphinx`` and dependencies). 3.5.1 (2011-08-04) ------------------ - Added Sphinx documentation. 3.5.0 (2010-05-01) ------------------ - Added change log to ``long-description``. - Support for Python 3.x. 3.4.1 (2009-03-03) ------------------ - A few minor cleanups. 3.4.0 (2007-07-14) ------------------ - Initial release as a separate project. zope.event-4.0.1/docs/0000775000175000017500000000000012053172013014441 5ustar tseavertseaverzope.event-4.0.1/docs/api.rst0000664000175000017500000000033712053170776015765 0ustar tseavertseaver:mod:`zope.event` API Reference =============================== The package exports the following API symbols. Data ---- .. autodata:: zope.event.subscribers Functions --------- .. autofunction:: zope.event.notify zope.event-4.0.1/docs/make.bat0000664000175000017500000000600512053170776016065 0ustar tseavertseaver@ECHO OFF REM Command file for Sphinx documentation set SPHINXBUILD=sphinx-build set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\zopeevent.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\zopeevent.ghc goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end zope.event-4.0.1/docs/Makefile0000664000175000017500000000607412053170776016126 0ustar tseavertseaver# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/zopeevent.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/zopeevent.qhc" latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." zope.event-4.0.1/docs/theory.rst0000664000175000017500000000073312053170776016526 0ustar tseavertseaverTheory of Operation =================== .. note:: This section explains both why an application or framework might publish events, and various ways the integrator might configure the subscribers to achieve different goals. Outline ------- - Events as decoupling mechanism. - Injecting policy into reusable applications. - Extending frameworks. - Event dispatch strategies - Type-based dispatch, as used in ZCA - Attribute-based / key-based dispatch zope.event-4.0.1/docs/conf.py0000664000175000017500000001513712053170776015765 0ustar tseavertseaver# -*- coding: utf-8 -*- # # zope.event documentation build configuration file, created by # sphinx-quickstart on Fri Apr 16 17:22:42 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os, pkg_resources # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.append(os.path.abspath('.')) sys.path.append(os.path.abspath('../src')) rqmt = pkg_resources.require('zope.event')[0] # -- General configuration ----------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8' # The master toctree document. master_doc = 'index' # General information about the project. project = u'zope.event' copyright = u'2010, Zope Foundation and Contributors' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2])) # The full version, including alpha/beta/rc tags. release = rqmt.version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of documents that shouldn't be included in the build. #unused_docs = [] # List of directories, relative to source directory, that shouldn't be searched # for source files. exclude_trees = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_use_modindex = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = 'zopeeventdoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'zopeevent.tex', u'zope.event Documentation', u'Zope Foundation and Contributors', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_use_modindex = True # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None} zope.event-4.0.1/docs/usage.rst0000664000175000017500000000340312053170776016315 0ustar tseavertseaverUsing :mod:`zope.event` ======================= The :mod:`zope.event` 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. .. doctest:: >>> import zope.event >>> old_subscribers = zope.event.subscribers[:] >>> del zope.event.subscribers[:] The package provides a :func:`notify` function, which is used to notify subscribers that something has happened: .. doctest:: >>> 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: .. doctest:: >>> zope.event.notify(None) >>> zope.event.notify(42) An extremely trivial subscription mechanism is provided. Subscribers are simply callback functions: .. doctest:: >>> def f(event): ... print 'got:', event that are put into the subscriptions list: .. doctest:: >>> 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: .. doctest:: >>> 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: .. doctest:: >>> zope.event.subscribers[:] = old_subscribers zope.event-4.0.1/docs/index.rst0000664000175000017500000000114012053170776016314 0ustar tseavertseaver:mod:`zope.event` Documentation =============================== 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. Contents: .. toctree:: :maxdepth: 2 usage theory api hacking Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` zope.event-4.0.1/docs/hacking.rst0000664000175000017500000002304412053170776016620 0ustar tseavertseaverHacking on :mod:`zope.event` ============================ Getting the Code ----------------- The main repository for :mod:`zope.event` is in the Zope Subversion repository: http://svn.zope.org/zope.event You can get a read-only Subversion checkout from there: .. code-block:: sh $ svn checkout svn://svn.zope.org/repos/main/zope.event/trunk zope.event The project also mirrors the trunk from the Subversion repository as a Bazaar branch on Launchpad: https://code.launchpad.net/zope.event You can branch the trunk from there using Bazaar: .. code-block:: sh $ bzr branch lp:zope.event Running the tests in a ``virtualenv`` ------------------------------------- If you use the ``virtualenv`` package to create lightweight Python development environments, you can run the tests using nothing more than the ``python`` binary in a virtualenv. First, create a scratch environment: .. code-block:: sh $ /path/to/virtualenv --no-site-packages /tmp/hack-zope.event Next, get this package registered as a "development egg" in the environment: .. code-block:: sh $ /tmp/hack-zope.event/bin/python setup.py develop Finally, run the tests using the build-in ``setuptools`` testrunner: .. code-block:: sh $ /tmp/hack-zope.event/bin/python setup.py test running test ... test_empty (zope.event.tests.Test_notify) ... ok test_not_empty (zope.event.tests.Test_notify) ... ok ---------------------------------------------------------------------- Ran 2 tests in 0.000s OK If you have the :mod:`nose` package installed in the virtualenv, you can use its testrunner too: .. code-block:: sh $ /tmp/hack-zope.event/bin/easy_install nose ... $ /tmp/hack-zope.event/bin/python setup.py nosetests running nosetests ... ---------------------------------------------------------------------- Ran 3 tests in 0.011s OK or: .. code-block:: sh $ /tmp/hack-zope.event/bin/nosetests ... ---------------------------------------------------------------------- Ran 3 tests in 0.011s OK If you have the :mod:`coverage` pacakge installed in the virtualenv, you can see how well the tests cover the code: .. code-block:: sh $ /tmp/hack-zope.event/bin/easy_install nose coverage ... $ /tmp/hack-zope.event/bin/python setup.py nosetests \ --with coverage --cover-package=zope.event running nosetests ... Name Stmts Exec Cover Missing ------------------------------------------ zope.event 5 5 100% ---------------------------------------------------------------------- Ran 3 tests in 0.019s OK Building the documentation in a ``virtualenv`` ---------------------------------------------- :mod:`zope.event` uses the nifty :mod:`Sphinx` documentation system for building its docs. Using the same virtualenv you set up to run the tests, you can build the docs: .. code-block:: sh $ /tmp/hack-zope.event/bin/easy_install Sphinx ... $ cd docs $ PATH=/tmp/hack-zope.event/bin:$PATH make html sphinx-build -b html -d _build/doctrees . _build/html ... build succeeded. Build finished. The HTML pages are in _build/html. You can also test the code snippets in the documentation: .. code-block:: sh $ PATH=/tmp/hack-zope.event/bin:$PATH make doctest sphinx-build -b doctest -d _build/doctrees . _build/doctest ... running tests... Document: index --------------- 1 items passed all tests: 17 tests in default 17 tests in 1 items. 17 passed and 0 failed. Test passed. Doctest summary =============== 17 tests 0 failures in tests 0 failures in setup code build succeeded. Testing of doctests in the sources finished, look at the \ results in _build/doctest/output.txt. Running the tests using :mod:`zc.buildout` ------------------------------------------- :mod:`zope.event` ships with its own :file:`buildout.cfg` file and :file:`bootstrap.py` for setting up a development buildout: .. code-block:: sh $ /path/to/python2.6 bootstrap.py ... Generated script '.../bin/buildout' $ bin/buildout Develop: '/home/tseaver/projects/Zope/BTK/event/.' ... Generated script '.../bin/sphinx-quickstart'. Generated script '.../bin/sphinx-build'. You can now run the tests: .. code-block:: sh $ bin/test --all Running zope.testing.testrunner.layer.UnitTests tests: Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds. Ran 2 tests with 0 failures and 0 errors in 0.000 seconds. Tearing down left over layers: Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds. Building the documentation using :mod:`zc.buildout` --------------------------------------------------- The :mod:`zope.event` buildout installs the Sphinx scripts required to build the documentation, including testing its code snippets: .. code-block:: sh $ cd docs $ PATH=../bin:$PATH make doctest html .../bin/sphinx-build -b doctest -d .../docs/_build/doctrees .../docs .../docs/_build/doctest running tests... Document: index --------------- 1 items passed all tests: 17 tests in default 17 tests in 1 items. 17 passed and 0 failed. Test passed. Doctest summary =============== 17 tests 0 failures in tests 0 failures in setup code build succeeded. Testing of doctests in the sources finished, look at the results in .../docs/_build/doctest/output.txt. .../bin/sphinx-build -b html -d .../docs/_build/doctrees .../docs .../docs/_build/html ... build succeeded. Build finished. The HTML pages are in .../docs/_build/html. Running Tests on Multiple Python Versions via :mod:`tox` -------------------------------------------------------- `tox `_ is a Python-based test automation tool designed to run tests against multiple Python versions. It creates a ``virtualenv`` for each configured version, installs the current package and configured dependencies into each ``virtualenv``, and then runs the configured commands. :mod:`zope.event` configures the following :mod:`tox` environments via its ``tox.ini`` file: - The ``py26`` environment builds a ``virtualenv`` with ``python2.6``, installs :mod:`zope.event`, and runs the tests via ``python setup.py test -q``. - The ``py27`` environment builds a ``virtualenv`` with ``python2.7``, installs :mod:`zope.event`, and runs the tests via ``python setup.py test -q``. - The ``py32`` environment builds a ``virtualenv`` with ``python3.2``, installs :mod:`zope.event` and dependencies, and runs the tests via ``python setup.py test -q``. - The ``pypy`` environment builds a ``virtualenv`` with ``pypy``, installs :mod:`zope.event`, and runs the tests via ``python setup.py test -q``. - The ``coverage`` environment builds a ``virtualenv`` with ``python2.6``, installs :mod:`zope.event`, installs :mod:`nose` and :mod:`coverage`, and runs ``nosetests`` with statement coverage. - The ``docs`` environment builds a virtualenv with ``python2.6``, installs :mod:`zope.event`, installs ``Sphinx`` and dependencies, and then builds the docs and exercises the doctest snippets. This example requires that you have a working ``python2.6`` on your path, as well as installing ``tox``: .. code-block:: sh $ tox -e py26 GLOB sdist-make: .../zope.interface/setup.py py26 sdist-reinst: .../zope.interface/.tox/dist/zope.interface-4.0.2dev.zip py26 runtests: commands[0] ... ---------------------------------------------------------------------- Ran 2 tests in 0.000s OK ___________________________________ summary ____________________________________ py26: commands succeeded congratulations :) Running ``tox`` with no arguments runs all the configured environments, including building the docs and testing their snippets: .. code-block:: sh $ tox GLOB sdist-make: .../zope.interface/setup.py py26 sdist-reinst: .../zope.interface/.tox/dist/zope.interface-4.0.2dev.zip py26 runtests: commands[0] ... Doctest summary =============== 17 tests 0 failures in tests 0 failures in setup code 0 failures in cleanup code build succeeded. ___________________________________ summary ____________________________________ py26: commands succeeded py27: commands succeeded py32: commands succeeded pypy: commands succeeded coverage: commands succeeded docs: commands succeeded congratulations :) Submitting a Bug Report ----------------------- :mod:`zope.event` tracks its bugs on Launchpad: https://bugs.launchpad.net/zope.event Please submit bug reports and feature requests there. Sharing Your Changes -------------------- .. note:: Please ensure that all tests are passing before you submit your code. If possible, your submission should include new tests for new features or bug fixes, although it is possible that you may have tested your new code by updating existing tests. If you got a read-only checkout from the Subversion repository, and you have made a change you would like to share, the best route is to let Subversion help you make a patch file: .. code-block:: sh $ svn diff > zope.event-cool_feature.patch You can then upload that patch file as an attachment to a Launchpad bug report. If you branched the code from Launchpad using Bazaar, you have another option: you can "push" your branch to Launchpad: .. code-block:: sh $ bzr push lp:~tseaver/zope.event/cool_feature After pushing your branch, you can link it to a bug report on Launchpad, or request that the maintainers merge your branch using the Launchpad "merge request" feature.