zope.browser-1.3/bootstrap.py0000644000000000000000000000733611366603674016366 0ustar rootroot00000000000000############################################################################## # # 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. $Id$ """ import os, shutil, sys, tempfile, urllib2 from optparse import OptionParser tmpeggs = tempfile.mkdtemp() is_jython = sys.platform.startswith('java') # parsing arguments parser = OptionParser() parser.add_option("-v", "--version", dest="version", help="use a specific zc.buildout version") parser.add_option("-d", "--distribute", action="store_true", dest="distribute", default=False, help="Use Disribute rather than Setuptools.") parser.add_option("-c", None, action="store", dest="config_file", help=("Specify the path to the buildout configuration " "file to be used.")) options, args = parser.parse_args() # if -c was provided, we push it back into args for buildout' main function if options.config_file is not None: args += ['-c', options.config_file] if options.version is not None: VERSION = '==%s' % options.version else: VERSION = '' USE_DISTRIBUTE = options.distribute args = args + ['bootstrap'] to_reload = False try: import pkg_resources if not hasattr(pkg_resources, '_distribute'): to_reload = True raise ImportError except ImportError: ez = {} if USE_DISTRIBUTE: exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py' ).read() in ez ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True) else: exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' ).read() in ez ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) if to_reload: reload(pkg_resources) else: import pkg_resources if sys.platform == 'win32': def quote(c): if ' ' in c: return '"%s"' % c # work around spawn lamosity on windows else: return c else: def quote (c): return c cmd = 'from setuptools.command.easy_install import main; main()' ws = pkg_resources.working_set if USE_DISTRIBUTE: requirement = 'distribute' else: requirement = 'setuptools' if is_jython: import subprocess assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd', quote(tmpeggs), 'zc.buildout' + VERSION], env=dict(os.environ, PYTHONPATH= ws.find(pkg_resources.Requirement.parse(requirement)).location ), ).wait() == 0 else: assert os.spawnle( os.P_WAIT, sys.executable, quote (sys.executable), '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION, dict(os.environ, PYTHONPATH= ws.find(pkg_resources.Requirement.parse(requirement)).location ), ) == 0 ws.add_entry(tmpeggs) ws.require('zc.buildout' + VERSION) import zc.buildout.buildout zc.buildout.buildout.main(args) shutil.rmtree(tmpeggs) zope.browser-1.3/buildout.cfg0000644000000000000000000000025311366604162016267 0ustar rootroot00000000000000[buildout] develop = . parts = test py [test] recipe = zc.recipe.testrunner eggs = zope.browser [test] [py] recipe = zc.recipe.egg eggs = zope.browser interpreter = py zope.browser-1.3/CHANGES.txt0000644000000000000000000000144111366604460015571 0ustar rootroot00000000000000Changelog ========= 1.3 (2010-04-30) ---------------- - Removed test extra and zope.testing dependency. 1.2 (2009-05-18) ---------------- - Moved ``ISystemErrorView`` interface here from ``zope.app.exception`` to break undesirable dependencies. - Fixed home page and author's e-mail address. - Added doctests to long_description. 1.1 (2009-05-13) ---------------- - Moved ``IAdding`` interface here from ``zope.app.container.interfaces`` to break undesirable dependencies. 1.0 (2009-05-13) ---------------- - Moved ``IView`` and ``IBrowserView`` interfaces here from ``zope.publisher.interfaces`` to break undesirable dependencies. 0.5.0 (2008-12-11) ------------------ - Moved ``ITerms`` interface here from ``zope.app.form.browser.interfaces`` to break undesirable dependencies. zope.browser-1.3/PKG-INFO0000644000000000000000000001133611366604552015063 0ustar rootroot00000000000000Metadata-Version: 1.0 Name: zope.browser Version: 1.3 Summary: Shared Zope Toolkit browser components Home-page: http://pypi.python.org/pypi/zope.browser Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: zope.browser ============ This package provides shared browser components for the Zope Toolkit. .. contents:: IView ----- Views adapt both a context and a request. There is not much we can test except that ``IView`` is importable and an interface: >>> 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``: >>> from zope.interface import Interface >>> from zope.browser.interfaces import IBrowserView >>> Interface.providedBy(IBrowserView) True >>> IBrowserView.extends(IView) True IAdding ------- Adding views manage how newly-created items get added to containers. There is not much we can test except that ``IAdding`` is importable and an interface derived from ``IBrowserView``: >>> from zope.interface import Interface >>> from zope.browser.interfaces import IAdding >>> Interface.providedBy(IBrowserView) True >>> IAdding.extends(IBrowserView) 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``, which made it impossible to use for other packages like ``z3c.form`` wihtout depending on ``zope.app.form``. Moving such base components / interfaces to ``zope.browser`` makes it possible to share them without undesirable dependencies. There is not much we can test except that ITerms is importable and an interface: >>> from zope.interface import Interface >>> from zope.browser.interfaces import ITerms >>> Interface.providedBy(ITerms) True ISystemErrorView ---------------- Views providing this interface can classify their contexts as system errors. These errors can be handled in a special way (e. g. more detailed logging). There is not much we can test except that ISystemErrorView is importable and an interface: >>> from zope.interface import Interface >>> from zope.browser.interfaces import ISystemErrorView >>> Interface.providedBy(ISystemErrorView) True Changelog ========= 1.3 (2010-04-30) ---------------- - Removed test extra and zope.testing dependency. 1.2 (2009-05-18) ---------------- - Moved ``ISystemErrorView`` interface here from ``zope.app.exception`` to break undesirable dependencies. - Fixed home page and author's e-mail address. - Added doctests to long_description. 1.1 (2009-05-13) ---------------- - Moved ``IAdding`` interface here from ``zope.app.container.interfaces`` to break undesirable dependencies. 1.0 (2009-05-13) ---------------- - Moved ``IView`` and ``IBrowserView`` interfaces here from ``zope.publisher.interfaces`` to break undesirable dependencies. 0.5.0 (2008-12-11) ------------------ - Moved ``ITerms`` interface here from ``zope.app.form.browser.interfaces`` to break undesirable dependencies. Keywords: zope browser component Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.browser-1.3/README.txt0000644000000000000000000000014111204303254015436 0ustar rootroot00000000000000zope.browser ============ This package provides shared browser components for the Zope Toolkit. zope.browser-1.3/setup.cfg0000644000000000000000000000007311366604552015603 0ustar rootroot00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 zope.browser-1.3/setup.py0000644000000000000000000000371511366604464015504 0ustar rootroot00000000000000############################################################################## # # Copyright (c) 2006 Zope Corporation 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. # ############################################################################## """Setup for zope.browser package $Id:$ """ 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.browser', version = '1.3', author='Zope Corporation and Contributors', author_email='zope-dev@zope.org', description='Shared Zope Toolkit browser components', long_description=( read('README.txt') + '\n\n.. contents::\n\n' + read('src', 'zope', 'browser', 'README.txt') + '\n\n' + read('CHANGES.txt') ), license='ZPL 2.1', keywords = "zope browser component", classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Zope Public License', 'Programming Language :: Python', 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Internet :: WWW/HTTP', 'Framework :: Zope3'], url='http://pypi.python.org/pypi/zope.browser', packages=find_packages('src'), package_dir = {'': 'src'}, namespace_packages=['zope',], install_requires=[ 'setuptools', 'zope.interface', ], include_package_data = True, zip_safe = False, ) zope.browser-1.3/src/zope/__init__.py0000644000000000000000000000031011366604162017626 0ustar rootroot00000000000000# this is a namespace package try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) zope.browser-1.3/src/zope/browser/__init__.py0000644000000000000000000000002111366604162021310 0ustar rootroot00000000000000# make a package zope.browser-1.3/src/zope/browser/interfaces.py0000644000000000000000000000657611366604162021721 0ustar rootroot00000000000000############################################################################## # # Copyright (c) 2004-2009 Zope Corporation 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. # ############################################################################## """Shared dependency less Zope3 brwoser components. """ __docformat__ = 'restructuredtext' from zope.interface import Attribute from zope.interface import Interface 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 IAdding(IBrowserView): """ Multi-adapter interface for views which add items to containers. o The 'context' of the view must implement ``zope.container.IContainer``. """ def add(content): """Add content object to context. Add using the name in `contentName`. Return the added object in the context of its container. If `contentName` is already used in container, raise ``zope.container.interfaces.DuplicateIDError``. """ contentName = Attribute( """The content name, usually set by the Adder traverser. If the content name hasn't been defined yet, returns ``None``. Some creation views might use this to optionally display the name on forms. """ ) def nextURL(): """Return the URL that the creation view should redirect to. This is called by the creation view after calling add. It is the adder's responsibility, not the creation view's to decide what page to display after content is added. """ def nameAllowed(): """Return whether names can be input by the user. """ def addingInfo(): """Return add menu data as a sequence of mappings. Each mapping contains 'action', 'title', and possibly other keys. The result is sorted by title. """ def isSingleMenuItem(): """Return whether there is single menu item or not.""" def hasCustomAddView(): "This should be called only if there is `singleMenuItem` else return 0" class ITerms(Interface): """ Adapter providing lookups for vocabulary terms. """ def getTerm(value): """Return an ITitledTokenizedTerm object for the given value LookupError is raised if the value isn't in the source """ def getValue(token): """Return a value for a given identifier token LookupError is raised if there isn't a value in the source. """ class ISystemErrorView(Interface): """Error views that can classify their contexts as system errors """ def isSystemError(): """Return a boolean indicating whether the error is a system errror """ zope.browser-1.3/src/zope/browser/README.txt0000644000000000000000000000424611204303254020677 0ustar rootroot00000000000000IView ----- Views adapt both a context and a request. There is not much we can test except that ``IView`` is importable and an interface: >>> 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``: >>> from zope.interface import Interface >>> from zope.browser.interfaces import IBrowserView >>> Interface.providedBy(IBrowserView) True >>> IBrowserView.extends(IView) True IAdding ------- Adding views manage how newly-created items get added to containers. There is not much we can test except that ``IAdding`` is importable and an interface derived from ``IBrowserView``: >>> from zope.interface import Interface >>> from zope.browser.interfaces import IAdding >>> Interface.providedBy(IBrowserView) True >>> IAdding.extends(IBrowserView) 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``, which made it impossible to use for other packages like ``z3c.form`` wihtout depending on ``zope.app.form``. Moving such base components / interfaces to ``zope.browser`` makes it possible to share them without undesirable dependencies. There is not much we can test except that ITerms is importable and an interface: >>> from zope.interface import Interface >>> from zope.browser.interfaces import ITerms >>> Interface.providedBy(ITerms) True ISystemErrorView ---------------- Views providing this interface can classify their contexts as system errors. These errors can be handled in a special way (e. g. more detailed logging). There is not much we can test except that ISystemErrorView is importable and an interface: >>> from zope.interface import Interface >>> from zope.browser.interfaces import ISystemErrorView >>> Interface.providedBy(ISystemErrorView) True zope.browser-1.3/src/zope/browser/tests.py0000644000000000000000000000172611366604240020725 0ustar rootroot00000000000000############################################################################## # # Copyright (c) 2007 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. # ############################################################################## """ $Id:$ """ __docformat__ = "reStructuredText" import doctest import unittest def test_suite(): return unittest.TestSuite(( doctest.DocFileSuite('README.txt', optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS, ), )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') zope.browser-1.3/src/zope.browser.egg-info/dependency_links.txt0000644000000000000000000000000111366604552024750 0ustar rootroot00000000000000 zope.browser-1.3/src/zope.browser.egg-info/namespace_packages.txt0000644000000000000000000000000511366604552025230 0ustar rootroot00000000000000zope zope.browser-1.3/src/zope.browser.egg-info/not-zip-safe0000644000000000000000000000000111366604224023124 0ustar rootroot00000000000000 zope.browser-1.3/src/zope.browser.egg-info/PKG-INFO0000644000000000000000000001133611366604552022003 0ustar rootroot00000000000000Metadata-Version: 1.0 Name: zope.browser Version: 1.3 Summary: Shared Zope Toolkit browser components Home-page: http://pypi.python.org/pypi/zope.browser Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: zope.browser ============ This package provides shared browser components for the Zope Toolkit. .. contents:: IView ----- Views adapt both a context and a request. There is not much we can test except that ``IView`` is importable and an interface: >>> 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``: >>> from zope.interface import Interface >>> from zope.browser.interfaces import IBrowserView >>> Interface.providedBy(IBrowserView) True >>> IBrowserView.extends(IView) True IAdding ------- Adding views manage how newly-created items get added to containers. There is not much we can test except that ``IAdding`` is importable and an interface derived from ``IBrowserView``: >>> from zope.interface import Interface >>> from zope.browser.interfaces import IAdding >>> Interface.providedBy(IBrowserView) True >>> IAdding.extends(IBrowserView) 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``, which made it impossible to use for other packages like ``z3c.form`` wihtout depending on ``zope.app.form``. Moving such base components / interfaces to ``zope.browser`` makes it possible to share them without undesirable dependencies. There is not much we can test except that ITerms is importable and an interface: >>> from zope.interface import Interface >>> from zope.browser.interfaces import ITerms >>> Interface.providedBy(ITerms) True ISystemErrorView ---------------- Views providing this interface can classify their contexts as system errors. These errors can be handled in a special way (e. g. more detailed logging). There is not much we can test except that ISystemErrorView is importable and an interface: >>> from zope.interface import Interface >>> from zope.browser.interfaces import ISystemErrorView >>> Interface.providedBy(ISystemErrorView) True Changelog ========= 1.3 (2010-04-30) ---------------- - Removed test extra and zope.testing dependency. 1.2 (2009-05-18) ---------------- - Moved ``ISystemErrorView`` interface here from ``zope.app.exception`` to break undesirable dependencies. - Fixed home page and author's e-mail address. - Added doctests to long_description. 1.1 (2009-05-13) ---------------- - Moved ``IAdding`` interface here from ``zope.app.container.interfaces`` to break undesirable dependencies. 1.0 (2009-05-13) ---------------- - Moved ``IView`` and ``IBrowserView`` interfaces here from ``zope.publisher.interfaces`` to break undesirable dependencies. 0.5.0 (2008-12-11) ------------------ - Moved ``ITerms`` interface here from ``zope.app.form.browser.interfaces`` to break undesirable dependencies. Keywords: zope browser component Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.browser-1.3/src/zope.browser.egg-info/requires.txt0000644000000000000000000000003111366604552023274 0ustar rootroot00000000000000setuptools zope.interfacezope.browser-1.3/src/zope.browser.egg-info/SOURCES.txt0000644000000000000000000000073711366604552022575 0ustar rootroot00000000000000CHANGES.txt README.txt bootstrap.py buildout.cfg setup.py src/zope/__init__.py src/zope.browser.egg-info/PKG-INFO src/zope.browser.egg-info/SOURCES.txt src/zope.browser.egg-info/dependency_links.txt src/zope.browser.egg-info/namespace_packages.txt src/zope.browser.egg-info/not-zip-safe src/zope.browser.egg-info/requires.txt src/zope.browser.egg-info/top_level.txt src/zope/browser/README.txt src/zope/browser/__init__.py src/zope/browser/interfaces.py src/zope/browser/tests.pyzope.browser-1.3/src/zope.browser.egg-info/top_level.txt0000644000000000000000000000000511366604552023427 0ustar rootroot00000000000000zope