zope.app.component-3.9.3/0000755000177100020040000000000011614046210016402 5ustar menesismenesis00000000000000zope.app.component-3.9.3/CHANGES.txt0000644000177100020040000001020111614045751020216 0ustar menesismenesis00000000000000======= CHANGES ======= 3.9.3 (2011-07-27) ------------------ - Replaced an undeclared test dependency on ``zope.app.authentication`` with ``zope.password``. - Removed unneeded dependencies. 3.9.2 (2010-09-17) ------------------ - Replaced a testing dependency on ``zope.app.securitypolicy`` with one on ``zope.securitypolicy``. 3.9.1 (2010-09-01) ------------------ - No longer using deprecated ``zope.testing.doctest``. Use python's build-in ``doctest`` instead. - Replaced the dependency on ``zope.deferredimport`` with BBB imports. 3.9.0 (2010-07-19) ------------------ - Added missing BBB import in ``zope.app.component.metaconfigure``. - Requiring at least ``zope.component`` 3.8 where some modules have moved which are BBB imported here. 3.8.4 (2010-01-08) ------------------ - Import hooks functionality from zope.component after it was moved there from zope.site. - Import ISite and IPossibleSite from zope.component after they were moved there from zope.location. This lifts the direct dependency on zope.location. - Fix tests using a newer zope.publisher that requires zope.login. 3.8.3 (2009-07-11) ------------------ - Removed unnecessary dependency on ``zope.app.interface``. 3.8.2 (2009-05-22) ------------------ - Fix missing import in ``zope.app.component.metadirectives``. 3.8.1 (2009-05-21) ------------------ - Add deprecation note. 3.8.0 (2009-05-21) ------------------ - IMPORTANT: this package is now empty except for some ZMI definitions in zope.app.component.browser. Functionality from this package has been moved to ``zope.site``, ``zope.componentvocabulary`` and ``zope.component``, so preferably import from those locations. - zope.componentvocabulary has the vocabulary implementations that were in zope.app.componentvocabulary now, import them from there for backwards compatibility. - moved zope:resource and zope:view directive implementation and tests over into zope.component [zcml]. 3.7.0 (2009-04-01) ------------------ - Removed deprecated `zope:defaultView` directive and its implementation. New directive to set default view is `browser:defaultView`. 3.6.1 (2009-03-12) ------------------ - Make ``class`` directive schemas importable from old location, raising a deprecation warning. It was moved in the previous release, but some custom directives could possibly use its schemas. - Deprecate import of ClassDirective to announce about new location. - Change package's mailing list address to zope-dev at zope.org, because zope3-dev at zope.org is now retired. - Adapt to the move of IDefaultViewName from zope.component.interfaces to zope.publisher.interfaces. 3.6.0 (2009-01-31) ------------------ - Moved the implementation of the directive from this package to `zope.security`. In particular, the module `zope.app.component.contentdirective` has moved to `zope.security.metaconfigure`, and a compatibility import has been left in its place. - Extracted `zope.site` from zope.app.component with backwards compatibility imports in place. Local site related functionality is now in `zope.site` and packages should import from there. - Remove more deprecated on 3.5 code: * zope.app.component.fields module that was pointing to the removed back35's LayerField. * zope.app.component.interface module that was moved to zope.component.interface ages ago. * zope:content and zope:localUtility directives. * zope:factory directive. * deprecated imports in zope.component.metaconfigure * browser:tool directive and all zope.component.browser meta.zcml stuff. - Remove "back35" extras_require as it doesn't make any sense now. - Remove zope.modulealias test dependency as it is not used anywhere. - Deprecate ISite and IPossibleSite imports from zope.app.component.interfaces. They were moved to zope.location.interfaces ages ago. Fix imports in zope.app.component itself. 3.5.0 (2008-10-13) ------------------ - Remove deprecated code slated for removal on 3.5. 3.4.1 (2007-10-31) ------------------ - Resolve ``ZopeSecurityPolicy`` deprecation warning. 3.4.0 (2007-10-11) ------------------ - Initial release independent of the main Zope tree. zope.app.component-3.9.3/PKG-INFO0000644000177100020040000001473011614046210017504 0ustar menesismenesis00000000000000Metadata-Version: 1.0 Name: zope.app.component Version: 3.9.3 Summary: Local Zope Component Support Home-page: http://pypi.python.org/pypi/zope.app.component Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: NOTE: this package is deprecated. Its functionality has been moved to more reusable packages, namely: zope.component, zope.security, zope.site and zope.componentvocabulary. Please import from there instead. This package provides various ZCML directives (view, resource) and a user interface related to local component management. .. contents:: ======= CHANGES ======= 3.9.3 (2011-07-27) ------------------ - Replaced an undeclared test dependency on ``zope.app.authentication`` with ``zope.password``. - Removed unneeded dependencies. 3.9.2 (2010-09-17) ------------------ - Replaced a testing dependency on ``zope.app.securitypolicy`` with one on ``zope.securitypolicy``. 3.9.1 (2010-09-01) ------------------ - No longer using deprecated ``zope.testing.doctest``. Use python's build-in ``doctest`` instead. - Replaced the dependency on ``zope.deferredimport`` with BBB imports. 3.9.0 (2010-07-19) ------------------ - Added missing BBB import in ``zope.app.component.metaconfigure``. - Requiring at least ``zope.component`` 3.8 where some modules have moved which are BBB imported here. 3.8.4 (2010-01-08) ------------------ - Import hooks functionality from zope.component after it was moved there from zope.site. - Import ISite and IPossibleSite from zope.component after they were moved there from zope.location. This lifts the direct dependency on zope.location. - Fix tests using a newer zope.publisher that requires zope.login. 3.8.3 (2009-07-11) ------------------ - Removed unnecessary dependency on ``zope.app.interface``. 3.8.2 (2009-05-22) ------------------ - Fix missing import in ``zope.app.component.metadirectives``. 3.8.1 (2009-05-21) ------------------ - Add deprecation note. 3.8.0 (2009-05-21) ------------------ - IMPORTANT: this package is now empty except for some ZMI definitions in zope.app.component.browser. Functionality from this package has been moved to ``zope.site``, ``zope.componentvocabulary`` and ``zope.component``, so preferably import from those locations. - zope.componentvocabulary has the vocabulary implementations that were in zope.app.componentvocabulary now, import them from there for backwards compatibility. - moved zope:resource and zope:view directive implementation and tests over into zope.component [zcml]. 3.7.0 (2009-04-01) ------------------ - Removed deprecated `zope:defaultView` directive and its implementation. New directive to set default view is `browser:defaultView`. 3.6.1 (2009-03-12) ------------------ - Make ``class`` directive schemas importable from old location, raising a deprecation warning. It was moved in the previous release, but some custom directives could possibly use its schemas. - Deprecate import of ClassDirective to announce about new location. - Change package's mailing list address to zope-dev at zope.org, because zope3-dev at zope.org is now retired. - Adapt to the move of IDefaultViewName from zope.component.interfaces to zope.publisher.interfaces. 3.6.0 (2009-01-31) ------------------ - Moved the implementation of the directive from this package to `zope.security`. In particular, the module `zope.app.component.contentdirective` has moved to `zope.security.metaconfigure`, and a compatibility import has been left in its place. - Extracted `zope.site` from zope.app.component with backwards compatibility imports in place. Local site related functionality is now in `zope.site` and packages should import from there. - Remove more deprecated on 3.5 code: * zope.app.component.fields module that was pointing to the removed back35's LayerField. * zope.app.component.interface module that was moved to zope.component.interface ages ago. * zope:content and zope:localUtility directives. * zope:factory directive. * deprecated imports in zope.component.metaconfigure * browser:tool directive and all zope.component.browser meta.zcml stuff. - Remove "back35" extras_require as it doesn't make any sense now. - Remove zope.modulealias test dependency as it is not used anywhere. - Deprecate ISite and IPossibleSite imports from zope.app.component.interfaces. They were moved to zope.location.interfaces ages ago. Fix imports in zope.app.component itself. 3.5.0 (2008-10-13) ------------------ - Remove deprecated code slated for removal on 3.5. 3.4.1 (2007-10-31) ------------------ - Resolve ``ZopeSecurityPolicy`` deprecation warning. 3.4.0 (2007-10-11) ------------------ - Initial release independent of the main Zope tree. Keywords: zope component architecture local 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.app.component-3.9.3/README.txt0000644000177100020040000000051311614045751020110 0ustar menesismenesis00000000000000NOTE: this package is deprecated. Its functionality has been moved to more reusable packages, namely: zope.component, zope.security, zope.site and zope.componentvocabulary. Please import from there instead. This package provides various ZCML directives (view, resource) and a user interface related to local component management. zope.app.component-3.9.3/setup.py0000644000177100020040000000566511614045751020141 0ustar menesismenesis00000000000000############################################################################## # # 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.app.component 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.app.component', version='3.9.3', author='Zope Corporation and Contributors', author_email='zope-dev@zope.org', description='Local Zope Component Support', long_description=( read('README.txt') + '\n\n.. contents:: \n\n' + read('CHANGES.txt') ), keywords="zope component architecture local", 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.app.component', license='ZPL 2.1', packages=find_packages('src'), package_dir={'': 'src'}, namespace_packages=['zope', 'zope.app'], extras_require=dict( test=[ 'zope.app.testing', 'zope.app.zcmlfiles', 'zope.login', 'zope.password', 'zope.securitypolicy', 'zope.testbrowser', ]), install_requires=[ 'setuptools', 'zope.site', 'zope.app.container', 'zope.app.pagetemplate', 'zope.component [hook,zcml] >= 3.8', 'zope.deprecation', 'zope.exceptions', 'zope.formlib', 'zope.i18nmessageid', 'zope.interface', 'zope.publisher>=3.12.0', 'zope.schema', 'zope.security', 'zope.traversing', 'zope.componentvocabulary', ], include_package_data=True, zip_safe=False, ) zope.app.component-3.9.3/COPYRIGHT.txt0000644000177100020040000000004011614045751020516 0ustar menesismenesis00000000000000Zope Foundation and Contributorszope.app.component-3.9.3/LICENSE.txt0000644000177100020040000000402611614045751020240 0ustar menesismenesis00000000000000Zope 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.app.component-3.9.3/bootstrap.py0000644000177100020040000000330211614045751021000 0ustar menesismenesis00000000000000############################################################################## # # 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 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.app.component-3.9.3/setup.cfg0000644000177100020040000000007311614046210020223 0ustar menesismenesis00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 zope.app.component-3.9.3/src/0000755000177100020040000000000011614046210017171 5ustar menesismenesis00000000000000zope.app.component-3.9.3/src/zope.app.component.egg-info/0000755000177100020040000000000011614046210024420 5ustar menesismenesis00000000000000zope.app.component-3.9.3/src/zope.app.component.egg-info/PKG-INFO0000644000177100020040000001473011614046206025527 0ustar menesismenesis00000000000000Metadata-Version: 1.0 Name: zope.app.component Version: 3.9.3 Summary: Local Zope Component Support Home-page: http://pypi.python.org/pypi/zope.app.component Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: NOTE: this package is deprecated. Its functionality has been moved to more reusable packages, namely: zope.component, zope.security, zope.site and zope.componentvocabulary. Please import from there instead. This package provides various ZCML directives (view, resource) and a user interface related to local component management. .. contents:: ======= CHANGES ======= 3.9.3 (2011-07-27) ------------------ - Replaced an undeclared test dependency on ``zope.app.authentication`` with ``zope.password``. - Removed unneeded dependencies. 3.9.2 (2010-09-17) ------------------ - Replaced a testing dependency on ``zope.app.securitypolicy`` with one on ``zope.securitypolicy``. 3.9.1 (2010-09-01) ------------------ - No longer using deprecated ``zope.testing.doctest``. Use python's build-in ``doctest`` instead. - Replaced the dependency on ``zope.deferredimport`` with BBB imports. 3.9.0 (2010-07-19) ------------------ - Added missing BBB import in ``zope.app.component.metaconfigure``. - Requiring at least ``zope.component`` 3.8 where some modules have moved which are BBB imported here. 3.8.4 (2010-01-08) ------------------ - Import hooks functionality from zope.component after it was moved there from zope.site. - Import ISite and IPossibleSite from zope.component after they were moved there from zope.location. This lifts the direct dependency on zope.location. - Fix tests using a newer zope.publisher that requires zope.login. 3.8.3 (2009-07-11) ------------------ - Removed unnecessary dependency on ``zope.app.interface``. 3.8.2 (2009-05-22) ------------------ - Fix missing import in ``zope.app.component.metadirectives``. 3.8.1 (2009-05-21) ------------------ - Add deprecation note. 3.8.0 (2009-05-21) ------------------ - IMPORTANT: this package is now empty except for some ZMI definitions in zope.app.component.browser. Functionality from this package has been moved to ``zope.site``, ``zope.componentvocabulary`` and ``zope.component``, so preferably import from those locations. - zope.componentvocabulary has the vocabulary implementations that were in zope.app.componentvocabulary now, import them from there for backwards compatibility. - moved zope:resource and zope:view directive implementation and tests over into zope.component [zcml]. 3.7.0 (2009-04-01) ------------------ - Removed deprecated `zope:defaultView` directive and its implementation. New directive to set default view is `browser:defaultView`. 3.6.1 (2009-03-12) ------------------ - Make ``class`` directive schemas importable from old location, raising a deprecation warning. It was moved in the previous release, but some custom directives could possibly use its schemas. - Deprecate import of ClassDirective to announce about new location. - Change package's mailing list address to zope-dev at zope.org, because zope3-dev at zope.org is now retired. - Adapt to the move of IDefaultViewName from zope.component.interfaces to zope.publisher.interfaces. 3.6.0 (2009-01-31) ------------------ - Moved the implementation of the directive from this package to `zope.security`. In particular, the module `zope.app.component.contentdirective` has moved to `zope.security.metaconfigure`, and a compatibility import has been left in its place. - Extracted `zope.site` from zope.app.component with backwards compatibility imports in place. Local site related functionality is now in `zope.site` and packages should import from there. - Remove more deprecated on 3.5 code: * zope.app.component.fields module that was pointing to the removed back35's LayerField. * zope.app.component.interface module that was moved to zope.component.interface ages ago. * zope:content and zope:localUtility directives. * zope:factory directive. * deprecated imports in zope.component.metaconfigure * browser:tool directive and all zope.component.browser meta.zcml stuff. - Remove "back35" extras_require as it doesn't make any sense now. - Remove zope.modulealias test dependency as it is not used anywhere. - Deprecate ISite and IPossibleSite imports from zope.app.component.interfaces. They were moved to zope.location.interfaces ages ago. Fix imports in zope.app.component itself. 3.5.0 (2008-10-13) ------------------ - Remove deprecated code slated for removal on 3.5. 3.4.1 (2007-10-31) ------------------ - Resolve ``ZopeSecurityPolicy`` deprecation warning. 3.4.0 (2007-10-11) ------------------ - Initial release independent of the main Zope tree. Keywords: zope component architecture local 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.app.component-3.9.3/src/zope.app.component.egg-info/top_level.txt0000644000177100020040000000000511614046206027152 0ustar menesismenesis00000000000000zope zope.app.component-3.9.3/src/zope.app.component.egg-info/SOURCES.txt0000644000177100020040000000250111614046206026307 0ustar menesismenesis00000000000000CHANGES.txt COPYRIGHT.txt LICENSE.txt README.txt bootstrap.py buildout.cfg setup.py src/zope/__init__.py src/zope.app.component.egg-info/PKG-INFO src/zope.app.component.egg-info/SOURCES.txt src/zope.app.component.egg-info/dependency_links.txt src/zope.app.component.egg-info/namespace_packages.txt src/zope.app.component.egg-info/not-zip-safe src/zope.app.component.egg-info/requires.txt src/zope.app.component.egg-info/top_level.txt src/zope/app/__init__.py src/zope/app/component/__init__.py src/zope/app/component/configure.zcml src/zope/app/component/contentdirective.py src/zope/app/component/ftesting.zcml src/zope/app/component/hooks.py src/zope/app/component/i18n.py src/zope/app/component/meta.zcml src/zope/app/component/metaconfigure.py src/zope/app/component/metadirectives.py src/zope/app/component/site.py src/zope/app/component/testing.py src/zope/app/component/vocabulary.py src/zope/app/component/browser/__init__.py src/zope/app/component/browser/configure.zcml src/zope/app/component/browser/ftesting.zcml src/zope/app/component/browser/registration.pt src/zope/app/component/browser/registration.py src/zope/app/component/browser/site.txt src/zope/app/component/browser/siteregistration.pt src/zope/app/component/browser/tests.py src/zope/app/component/interfaces/__init__.py src/zope/app/component/interfaces/registration.pyzope.app.component-3.9.3/src/zope.app.component.egg-info/namespace_packages.txt0000644000177100020040000000001611614046206030755 0ustar menesismenesis00000000000000zope zope.app zope.app.component-3.9.3/src/zope.app.component.egg-info/not-zip-safe0000644000177100020040000000000111614045753026661 0ustar menesismenesis00000000000000 zope.app.component-3.9.3/src/zope.app.component.egg-info/dependency_links.txt0000644000177100020040000000000111614046206030473 0ustar menesismenesis00000000000000 zope.app.component-3.9.3/src/zope.app.component.egg-info/requires.txt0000644000177100020040000000056311614046206027031 0ustar menesismenesis00000000000000setuptools zope.site zope.app.container zope.app.pagetemplate zope.component [hook,zcml] >= 3.8 zope.deprecation zope.exceptions zope.formlib zope.i18nmessageid zope.interface zope.publisher>=3.12.0 zope.schema zope.security zope.traversing zope.componentvocabulary [test] zope.app.testing zope.app.zcmlfiles zope.login zope.password zope.securitypolicy zope.testbrowserzope.app.component-3.9.3/src/zope/0000755000177100020040000000000011614046210020146 5ustar menesismenesis00000000000000zope.app.component-3.9.3/src/zope/__init__.py0000644000177100020040000000031111614045751022263 0ustar menesismenesis00000000000000# 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.app.component-3.9.3/src/zope/app/0000755000177100020040000000000011614046210020726 5ustar menesismenesis00000000000000zope.app.component-3.9.3/src/zope/app/__init__.py0000644000177100020040000000031111614045751023043 0ustar menesismenesis00000000000000# 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.app.component-3.9.3/src/zope/app/component/0000755000177100020040000000000011614046210022730 5ustar menesismenesis00000000000000zope.app.component-3.9.3/src/zope/app/component/testing.py0000644000177100020040000001474011614045751024776 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2001-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. # ############################################################################## """Base Mix-in class for Placeful Setups Also contains common test related classes/functions/objects. """ import os import zope.interface import zope.site.folder from zope.component.interfaces import IComponentLookup from zope.app.component.interfaces import ILocalSiteManager from zope.app.testing import setup from zope.app.testing.placelesssetup import PlacelessSetup from zope.app.testing.functional import ZCMLLayer from zope.traversing.api import traverse AppComponentLayer = ZCMLLayer( os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'), __name__, 'AppComponentLayer', allow_teardown=True) class Place(object): def __init__(self, path): self.path = path def __get__(self, inst, cls=None): if inst is None: return self try: # Use __dict__ directly to avoid infinite recursion root = inst.__dict__['rootFolder'] except KeyError: root = inst.rootFolder = setup.buildSampleFolderTree() return traverse(root, self.path) class PlacefulSetup(PlacelessSetup): # Places :) rootFolder = Place(u'') folder1 = Place(u'folder1') folder1_1 = Place(u'folder1/folder1_1') folder1_1_1 = Place(u'folder1/folder1_1/folder1_1_1') folder1_1_2 = Place(u'folder1/folder1_2/folder1_1_2') folder1_2 = Place(u'folder1/folder1_2') folder1_2_1 = Place(u'folder1/folder1_2/folder1_2_1') folder2 = Place(u'folder2') folder2_1 = Place(u'folder2/folder2_1') folder2_1_1 = Place(u'folder2/folder2_1/folder2_1_1') folder3 = Place(u"\N{CYRILLIC SMALL LETTER PE}" u"\N{CYRILLIC SMALL LETTER A}" u"\N{CYRILLIC SMALL LETTER PE}" u"\N{CYRILLIC SMALL LETTER KA}" u"\N{CYRILLIC SMALL LETTER A}3") folder3_1 = Place(u"\N{CYRILLIC SMALL LETTER PE}" u"\N{CYRILLIC SMALL LETTER A}" u"\N{CYRILLIC SMALL LETTER PE}" u"\N{CYRILLIC SMALL LETTER KA}" u"\N{CYRILLIC SMALL LETTER A}3/" u"\N{CYRILLIC SMALL LETTER PE}" u"\N{CYRILLIC SMALL LETTER A}" u"\N{CYRILLIC SMALL LETTER PE}" u"\N{CYRILLIC SMALL LETTER KA}" u"\N{CYRILLIC SMALL LETTER A}3_1") def setUp(self, folders=False, site=False): setup.placefulSetUp() if folders or site: return self.buildFolders(site) def tearDown(self): setup.placefulTearDown() # clean up folders and placeful site managers and services too? def buildFolders(self, site=False): self.rootFolder = setup.buildSampleFolderTree() if site: return self.makeSite() def makeSite(self, path='/'): folder = traverse(self.rootFolder, path) return setup.createSiteManager(folder, True) def createRootFolder(self): self.rootFolder = zope.site.folder.rootFolder() class SiteManagerStub(object): zope.interface.implements(ILocalSiteManager) __bases__ = () def __init__(self): self._utils = {} def setNext(self, next): self.__bases__ = (next, ) def provideUtility(self, iface, util, name=''): self._utils[(iface, name)] = util def queryUtility(self, iface, name='', default=None): return self._utils.get((iface, name), default) def testingNextUtility(utility, nextutility, interface, name='', sitemanager=None, nextsitemanager=None): """Provide a next utility for testing. Since utilities must be registered in sites, we really provide a next site manager in which we place the next utility. If you do not pass in any site managers, they will be created for you. For a simple usage of this function, see the doc test of `queryNextUtility()`. Here is a demonstration that passes in the services directly and ensures that the `__parent__` attributes are set correctly. First, we need to create a utility interface and implementation: >>> from zope.interface import Interface, implements >>> class IAnyUtility(Interface): ... pass >>> class AnyUtility(object): ... implements(IAnyUtility) ... def __init__(self, id): ... self.id = id >>> any1 = AnyUtility(1) >>> any1next = AnyUtility(2) Now we create a special site manager that can have a location: >>> SiteManager = type('SiteManager', (GlobalSiteManager,), ... {'__parent__': None}) Let's now create one site manager >>> sm = SiteManager() and pass it in as the original site manager to the function: >>> testingNextUtility(any1, any1next, IAnyUtility, sitemanager=sm) >>> any1.__parent__ is utils True >>> smnext = any1next.__parent__ >>> sm.__parent__.next.data['Utilities'] is smnext True or if we pass the current and the next site manager: >>> sm = SiteManager() >>> smnext = SiteManager() >>> testingNextUtility(any1, any1next, IAnyUtility, ... sitemanager=sm, nextsitemanager=smnext) >>> any1.__parent__ is sm True >>> any1next.__parent__ is smnext True """ if sitemanager is None: sitemanager = SiteManagerStub() if nextsitemanager is None: nextsitemanager = SiteManagerStub() sitemanager.setNext(nextsitemanager) sitemanager.provideUtility(interface, utility, name) utility.__conform__ = ( lambda iface: iface.isOrExtends(IComponentLookup) and sitemanager or None ) nextsitemanager.provideUtility(interface, nextutility, name) nextutility.__conform__ = ( lambda iface: iface.isOrExtends(IComponentLookup) and nextsitemanager or None ) zope.app.component-3.9.3/src/zope/app/component/site.py0000644000177100020040000000260511614045751024262 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2001, 2002 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 module here is for backwards compatibility. The real public API is now zope.site """ # on the side of caution for backwards compatibility we # import everything defined from zope.component.hooks import setSite from zope.site.site import (SiteManagementFolder, SMFolderFactory, SiteManagerContainer, _findNextSiteManager, _LocalAdapterRegistry, LocalSiteManager, threadSiteSubscriber, clearThreadSiteSubscriber, clearSite, SiteManagerAdapter, changeSiteConfigurationAfterMove) # BBB zope.app.component-3.9.3/src/zope/app/component/interfaces/0000755000177100020040000000000011614046210025053 5ustar menesismenesis00000000000000zope.app.component-3.9.3/src/zope/app/component/interfaces/__init__.py0000644000177100020040000000167511614045751027206 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2002 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. # ############################################################################## # BBB from zope.site.interfaces import (INewLocalSite, NewLocalSite, ILocalSiteManager, ISiteManagementFolder) # BBB from zope.component.interfaces import (ISite, IPossibleSite) zope.app.component-3.9.3/src/zope/app/component/interfaces/registration.py0000644000177100020040000000222411614045751030150 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2002 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. # ############################################################################## """Interfaces for objects supporting registration """ from zope import interface, schema import zope.schema.interfaces class IComponent(zope.schema.interfaces.IField): """A component This is just the interface for the ComponentPath field below. We'll use this as the basis for looking up an appropriate widget. """ class Component(schema.Field): """A component Values of the field are absolute unicode path strings that can be traversed to get an object. """ interface.implements(IComponent) zope.app.component-3.9.3/src/zope/app/component/__init__.py0000644000177100020040000000453011614045751025054 0ustar menesismenesis00000000000000############################################################################## # # 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. # ############################################################################## """Local Component Architecture """ __docformat__ = "reStructuredText" import zope.component import zope.deprecation from zope.site import getNextUtility, queryNextUtility # BBB _marker = object() # BBB: Deprecated on 9/26/2006 @zope.deprecation.deprecate('''This function has been deprecated and will go away in Zope 3.6. There is no replacement for this function, since it does not make sense in light of registry bases anymore. If you are using this function to lookup the next utility, consider using get/queryNextUtility. Otherwise, it is suggested to iterate through the list of bases of a registry manually.''') def getNextSiteManager(context): """Get the next site manager.""" sm = queryNextSiteManager(context, _marker) if sm is _marker: raise zope.component.interfaces.ComponentLookupError( "No more site managers have been found.") return sm # BBB: Deprecated on 9/26/2006 @zope.deprecation.deprecate('''This function has been deprecated and will go away in Zope 3.6. There is no replacement for this function, since it does not make sense in light of registry bases anymore. If you are using this function to lookup the next utility, consider using get/queryNextUtility. Otherwise, it is suggested to iterate through the list of bases of a registry manually.''') def queryNextSiteManager(context, default=None): """Get the next site manager. If the site manager of the given context is the global site manager, then `default` is returned. """ sm = zope.component.getSiteManager(context) if sm is zope.component.getGlobalSiteManager(): return default bases = sm.__bases__ if not bases: return zope.component.getGlobalSiteManager() return bases[0] zope.app.component-3.9.3/src/zope/app/component/i18n.py0000644000177100020040000000157211614045751024077 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2003 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. # ############################################################################## """Customization of zope.i18n for the Zope application server """ __docformat__ = 'restructuredtext' # import this as _ to create i18n messages in the zope domain from zope.i18nmessageid import MessageFactory ZopeMessageFactory = MessageFactory('zope') zope.app.component-3.9.3/src/zope/app/component/metadirectives.py0000644000177100020040000000224611614045751026327 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2001, 2002 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. # ############################################################################## # BBB from zope.security.metadirectives import (IClassDirective, IImplementsSubdirective, IRequireSubdirective, IAllowSubdirective, IFactorySubdirective) # BBB from zope.component.zcml import (IBasicViewInformation, IBasicResourceInformation, IViewDirective, IResourceDirective) zope.app.component-3.9.3/src/zope/app/component/contentdirective.py0000644000177100020040000000142311614045751026664 0ustar menesismenesis00000000000000############################################################################# # # Copyright (c) 2001, 2002 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. # ############################################################################## """Backwards compatibility: moved this module to `zope.security.metaconfigure`. """ # BBB from zope.security.metaconfigure import ClassDirective zope.app.component-3.9.3/src/zope/app/component/configure.zcml0000644000177100020040000000031211614045751025605 0ustar menesismenesis00000000000000 zope.app.component-3.9.3/src/zope/app/component/ftesting.zcml0000644000177100020040000000155311614045751025457 0ustar menesismenesis00000000000000 zope.app.component-3.9.3/src/zope/app/component/meta.zcml0000644000177100020040000000052111614045751024554 0ustar menesismenesis00000000000000 zope.app.component-3.9.3/src/zope/app/component/metaconfigure.py0000644000177100020040000000140111614045751026137 0ustar menesismenesis00000000000000############################################################################# # # Copyright (c) 2001, 2002 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. # ############################################################################## # BBB from zope.component.security import PublicPermission, _checker from zope.component.zcml import view, resource, subscriber zope.app.component-3.9.3/src/zope/app/component/browser/0000755000177100020040000000000011614046210024413 5ustar menesismenesis00000000000000zope.app.component-3.9.3/src/zope/app/component/browser/siteregistration.pt0000644000177100020040000000351411614045751030373 0ustar menesismenesis00000000000000

Nothing is registered for this site.

Registrations for this site:

foo/bar foo/bar (moved or deleted)
zope.app.fooIFoo utility named bob
comment: needed a bob
zope.app.component-3.9.3/src/zope/app/component/browser/__init__.py0000644000177100020040000001317411614045751026543 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2002 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. # ############################################################################## """View support for adding and configuring utilities and adapters. """ __docformat__ = 'restructuredtext' import zope.component import zope.component.interfaces from zope.exceptions.interfaces import UserError from zope.security.proxy import removeSecurityProxy from zope.publisher.browser import BrowserView from zope.component.interfaces import IFactory from zope.component.interface import searchInterface from zope.app.component.i18n import ZopeMessageFactory as _ from zope.app.container.browser.adding import Adding from zope.app.component.site import LocalSiteManager class ComponentAdding(Adding): """Adding subclass used for registerable components.""" menu_id = "add_component" def add(self, content): # Override so as to save a reference to the added object self.added_object = super(ComponentAdding, self).add(content) return self.added_object def nextURL(self): v = zope.component.queryMultiAdapter( (self.added_object, self.request), name="registration.html") if v is not None: url = str(zope.component.getMultiAdapter( (self.added_object, self.request), name='absolute_url')) return url + "/@@registration.html" return super(ComponentAdding, self).nextURL() def action(self, type_name, id=''): # For special case of that we want to redirect to another adding view # (usually another menu such as AddUtility) if type_name.startswith("../"): # Special case url = type_name if id: url += "?id=" + id self.request.response.redirect(url) return # Call the superclass action() method. # As a side effect, self.added_object is set by add() above. super(ComponentAdding, self).action(type_name, id) _addFilterInterface = None def addingInfo(self): # A site management folder can have many things. We only want # things that implement a particular interface info = super(ComponentAdding, self).addingInfo() if self._addFilterInterface is None: return info out = [] for item in info: extra = item.get('extra') if extra: factoryname = extra.get('factory') if factoryname: factory = zope.component.getUtility(IFactory, factoryname) intf = factory.getInterfaces() if not intf.extends(self._addFilterInterface): # We only skip new addMenuItem style objects # that don't implement our wanted interface. continue out.append(item) return out class UtilityAdding(ComponentAdding): """Adding subclass used for adding utilities.""" menu_id = None title = _("Add Utility") def nextURL(self): v = zope.component.queryMultiAdapter( (self.added_object, self.request), name="addRegistration.html") if v is not None: url = zope.component.absoluteURL(self.added_object, self.request) return url + "/@@addRegistration.html" return super(UtilityAdding, self).nextURL() class MakeSite(BrowserView): """View for converting a possible site to a site.""" def addSiteManager(self): """Convert a possible site to a site >>> from zope.traversing.interfaces import IContainmentRoot >>> from zope.interface import implements >>> class PossibleSite(object): ... implements(IContainmentRoot) ... def setSiteManager(self, sm): ... from zope.interface import directlyProvides ... directlyProvides(self, zope.component.interfaces.ISite) >>> folder = PossibleSite() >>> from zope.publisher.browser import TestRequest >>> request = TestRequest() Now we'll make our folder a site: >>> MakeSite(folder, request).addSiteManager() Now verify that we have a site: >>> zope.component.interfaces.ISite.providedBy(folder) 1 Note that we've also redirected the request: >>> request.response.getStatus() 302 >>> request.response.getHeader('location') '++etc++site/@@SelectedManagementView.html' If we try to do it again, we'll fail: >>> MakeSite(folder, request).addSiteManager() Traceback (most recent call last): ... UserError: This is already a site """ if zope.component.interfaces.ISite.providedBy(self.context): raise UserError(_(u'This is already a site')) # We don't want to store security proxies (we can't, # actually), so we have to remove proxies here before passing # the context to the SiteManager. bare = removeSecurityProxy(self.context) sm = LocalSiteManager(bare) self.context.setSiteManager(sm) self.request.response.redirect( "++etc++site/@@SelectedManagementView.html") zope.app.component-3.9.3/src/zope/app/component/browser/configure.zcml0000644000177100020040000000763511614045751027307 0ustar menesismenesis00000000000000 zope.app.component-3.9.3/src/zope/app/component/browser/ftesting.zcml0000644000177100020040000000055411614045751027142 0ustar menesismenesis00000000000000 zope.app.component-3.9.3/src/zope/app/component/browser/tests.py0000644000177100020040000000275411614045751026150 0ustar menesismenesis00000000000000############################################################################## # # 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. # ############################################################################## """Registration functional tests """ from zope import interface from zope.app.component.testing import AppComponentLayer from zope.app.testing import functional import doctest import os.path import unittest import zope.app.testing.functional AppComponentBrowserLayer = functional.ZCMLLayer( os.path.join(os.path.dirname(__file__), 'ftesting.zcml'), __name__, 'AppComponentBrowserLayer', allow_teardown=True) class ISampleBase(interface.Interface): pass class ISample(ISampleBase): pass class Sample: interface.implements(ISample) def test_suite(): site = zope.app.testing.functional.FunctionalDocFileSuite( "site.txt", optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE) site.layer = AppComponentBrowserLayer return unittest.TestSuite((site,)) if __name__ == '__main__': unittest.main(defaultTest='test_suite') zope.app.component-3.9.3/src/zope/app/component/browser/registration.py0000644000177100020040000002061511614045751027514 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2003 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. # ############################################################################## """General registry-related views """ import warnings from zope import interface, component, schema from zope.formlib import form from zope.publisher.browser import BrowserPage from zope.security.proxy import removeSecurityProxy import zope.component.interfaces import zope.publisher.interfaces.browser import zope.app.pagetemplate from zope.app.component.i18n import ZopeMessageFactory as _ def _registrations(context, comp): sm = component.getSiteManager(context) for r in sm.registeredUtilities(): if r.component == comp or comp is None: yield r for r in sm.registeredAdapters(): if r.factory == comp or comp is None: yield r for r in sm.registeredSubscriptionAdapters(): if r.factory == comp or comp is None: yield r for r in sm.registeredHandlers(): if r.factory == comp or comp is None: yield r class IRegistrationDisplay(interface.Interface): """Display registration information """ def id(): """Return an identifier suitable for use in mapping """ def render(): "Return an HTML view of a registration object" def unregister(): "Remove the registration by unregistering the component" class ISiteRegistrationDisplay(IRegistrationDisplay): """Display registration information, including the component registered """ class RegistrationView(BrowserPage): component.adapts(None, zope.publisher.interfaces.browser.IBrowserRequest) render = zope.app.pagetemplate.ViewPageTemplateFile('registration.pt') def registrations(self): registrations = [ component.getMultiAdapter((r, self.request), IRegistrationDisplay) for r in sorted(_registrations(self.context, self.context)) ] return registrations def update(self): registrations = dict([(r.id(), r) for r in self.registrations()]) for id in self.request.form.get('ids', ()): r = registrations.get(id) if r is not None: r.unregister() def __call__(self): self.update() return self.render() class UtilityRegistrationDisplay(object): """Utility Registration Details""" component.adapts(zope.component.interfaces.IUtilityRegistration, zope.publisher.interfaces.browser.IBrowserRequest) interface.implements(IRegistrationDisplay) def __init__(self, context, request): self.context = context self.request = request def provided(self): provided = self.context.provided return provided.__module__ + '.' + provided.__name__ def id(self): return 'R' + (("%s %s" % (self.provided(), self.context.name)) .encode('utf8') .encode('base64') .replace('+', '_') .replace('=', '') .replace('\n', '') ) def _comment(self): comment = self.context.info or '' if comment: comment = _("comment: ${comment}", mapping={"comment": comment}) return comment def _provided(self): name = self.context.name provided = self.provided() if name: info = _("${provided} utility named '${name}'", mapping={"provided": provided, "name": name}) else: info = _("${provided} utility", mapping={"provided": provided}) return info def render(self): return { "info": self._provided(), "comment": self._comment() } def unregister(self): self.context.registry.unregisterUtility( self.context.component, self.context.provided, self.context.name, ) class SiteRegistrationView(RegistrationView): render = zope.app.pagetemplate.ViewPageTemplateFile('siteregistration.pt') def registrations(self): registrations = [ component.getMultiAdapter((r, self.request), ISiteRegistrationDisplay) for r in sorted(_registrations(self.context, None)) ] return registrations class UtilitySiteRegistrationDisplay(UtilityRegistrationDisplay): """Utility Registration Details""" interface.implementsOnly(ISiteRegistrationDisplay) def render(self): url = component.getMultiAdapter( (self.context.component, self.request), name='absolute_url') try: url = url() except TypeError: url = "" cname = getattr(self.context.component, '__name__', '') if not cname: cname = _("(unknown name)") if url: url += "/@@SelectedManagementView.html" return { "cname": cname, "url": url, "info": self._provided(), "comment": self._comment() } class AddUtilityRegistration(form.Form): """View for registering utilities Normally, the provided interface and name are input. A subclass can provide an empty 'name' attribute if the component should always be registered without a name. A subclass can provide a 'provided' attribute if a component should always be registered with the same interface. """ component.adapts(None, zope.publisher.interfaces.browser.IBrowserRequest) form_fields = form.Fields( schema.Choice( __name__ = 'provided', title=_("Provided interface"), description=_("The interface provided by the utility"), vocabulary="Utility Component Interfaces", required=True, ), schema.TextLine( __name__ = 'name', title=_("Register As"), description=_("The name under which the utility will be known."), required=False, default=u'', missing_value=u'' ), schema.Text( __name__ = 'comment', title=_("Comment"), required=False, default=u'', missing_value=u'' ), ) name = provided = None prefix = 'field' # in hopes of making old tests pass. :) def __init__(self, context, request): if self.name is not None: self.form_fields = self.form_fields.omit('name') if self.provided is not None: self.form_fields = self.form_fields.omit('provided') super(AddUtilityRegistration, self).__init__(context, request) def update(self): # hack to make work with old tests if 'UPDATE_SUBMIT' in self.request.form: warnings.warn( "Old test needs to be updated.", DeprecationWarning) self.request.form['field.actions.register'] = 'Register' self.request.form['field.comment'] = u'' super(AddUtilityRegistration, self).update() @property def label(self): return _("Register a $classname", mapping=dict(classname=self.context.__class__.__name__) ) @form.action(_("Register")) def register(self, action, data): sm = component.getSiteManager(self.context) name = self.name if name is None: name = data['name'] provided = self.provided if provided is None: provided = data['provided'] # We have to remove the security proxy to save the registration sm.registerUtility( removeSecurityProxy(self.context), provided, name, data['comment'] or '') if 'UPDATE_SUBMIT' in self.request.form: # Backward compat until 3.5 self.request.response.redirect('@@SelectedManagementView.html') return self.request.response.redirect('@@registration.html') zope.app.component-3.9.3/src/zope/app/component/browser/site.txt0000644000177100020040000000235011614045751026131 0ustar menesismenesis00000000000000Managing a Site --------------- Create the browser object we'll be using. >>> from zope.testbrowser.testing import Browser >>> browser = Browser() >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw') >>> browser.open('http://localhost/manage') When we originally enter a Zope instance, there is only a root folder that is already a site: >>> 'Manage Site' in browser.contents True Let's now add a new folder called ``samplesite`` and make it a site: >>> browser.getLink(url='folder.Folder').click() >>> browser.getControl(name='new_value').value = 'samplesite' >>> browser.getControl('Apply').click() >>> browser.getLink('samplesite').click() >>> browser.getLink('Make a site').click() We are automatically forwarded to the site manager of the site. The default site management folder is always available: >>> 'default' in browser.contents True Let's now delete the site again: >>> browser.getLink('[top]').click() >>> browser.getControl(name='ids:list').getControl( ... value='samplesite').selected = True >>> browser.handleErrors = False >>> browser.getControl('Delete').click() The site should be gone now. >>> 'samplesite' in browser.contents False zope.app.component-3.9.3/src/zope/app/component/browser/registration.pt0000644000177100020040000000332011614045751027501 0ustar menesismenesis00000000000000

This object isn't yet registered.

This object is registered:

zope.app.fooIFoo utility named bob
comment: needed a bob
zope.app.component-3.9.3/src/zope/app/component/hooks.py0000644000177100020040000000236411614045751024443 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2001, 2002 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 module here is for backwards compatibility. The real public API is now zope.component.hooks """ __docformat__ = 'restructuredtext' from zope.component.hooks import ( read_property, SiteInfo, siteinfo, setSite, getSite, getSiteManager, adapter_hook, setHooks, resetHooks, setSite, clearSite) # BBB zope.app.component-3.9.3/src/zope/app/component/vocabulary.py0000644000177100020040000000147611614045751025472 0ustar menesismenesis00000000000000############################################################################## # # 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. # ############################################################################## # BBB from zope.componentvocabulary.vocabulary import ( UtilityTerm, UtilityVocabulary, InterfacesVocabulary, UtilityComponentInterfacesVocabulary, UtilityNameTerm, UtilityNames) zope.app.component-3.9.3/buildout.cfg0000644000177100020040000000062211614045751020723 0ustar menesismenesis00000000000000[buildout] develop = . parts = test coverage-test coverage-report [test] recipe = zc.recipe.testrunner eggs = zope.app.component [test] [coverage-test] recipe = zc.recipe.testrunner eggs = zope.app.component [test] defaults = ['--coverage', '../../coverage'] [coverage-report] recipe = zc.recipe.egg eggs = z3c.coverage scripts = coverage=coverage-report arguments = ('coverage', 'coverage/report')