zope.app.content-3.5.1/0000755000177100020040000000000011504177656014625 5ustar menesismenesiszope.app.content-3.5.1/CHANGES.txt0000644000177100020040000000057211504177313016430 0ustar menesismenesis======= CHANGES ======= 3.5.1 (2010-12-21) ------------------ - Replace ``zope.app.component`` dependency with ``zope.componentvocabulary``. 3.5.0 (2010-09-20) ------------------ - Moved ``zope.app.interface.queryType`` to ``zope.app.content.queryType`` to inverse dependency. 3.4.0 (2007-10-11) ------------------ - Initial release independent of the main Zope tree. zope.app.content-3.5.1/PKG-INFO0000644000177100020040000000255311504177656015727 0ustar menesismenesisMetadata-Version: 1.0 Name: zope.app.content Version: 3.5.1 Summary: Zope Content Type Home-page: http://cheeseshop.python.org/pypi/zope.app.content Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: This package defines an ``IInterface`` that allows the developer to mark interfaces as content types. ======= CHANGES ======= 3.5.1 (2010-12-21) ------------------ - Replace ``zope.app.component`` dependency with ``zope.componentvocabulary``. 3.5.0 (2010-09-20) ------------------ - Moved ``zope.app.interface.queryType`` to ``zope.app.content.queryType`` to inverse dependency. 3.4.0 (2007-10-11) ------------------ - Initial release independent of the main Zope tree. Keywords: zope3 content type 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.content-3.5.1/README.txt0000644000177100020040000000014611504177313016312 0ustar menesismenesisThis package defines an ``IInterface`` that allows the developer to mark interfaces as content types. zope.app.content-3.5.1/setup.py0000644000177100020040000000471511504177313016334 0ustar menesismenesis############################################################################## # # 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.content 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.content', version='3.5.1', author='Zope Foundation and Contributors', author_email='zope-dev@zope.org', description='Zope Content Type', long_description=( read('README.txt') + '\n\n' + read('CHANGES.txt') ), keywords = "zope3 content type", 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://cheeseshop.python.org/pypi/zope.app.content', license='ZPL 2.1', packages=find_packages('src'), package_dir = {'': 'src'}, namespace_packages=['zope', 'zope.app'], install_requires=['setuptools', 'zope.componentvocabulary', 'zope.interface', 'zope.schema', 'zope.security', ], extras_require=dict(test=[ 'zope.testing', ]), include_package_data = True, zip_safe = False, ) zope.app.content-3.5.1/COPYRIGHT.txt0000644000177100020040000000004011504177313016716 0ustar menesismenesisZope Foundation and Contributorszope.app.content-3.5.1/LICENSE.txt0000644000177100020040000000402611504177313016440 0ustar menesismenesisZope 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.content-3.5.1/bootstrap.py0000644000177100020040000000330211504177313017200 0ustar menesismenesis############################################################################## # # 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.content-3.5.1/setup.cfg0000644000177100020040000000007311504177656016446 0ustar menesismenesis[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 zope.app.content-3.5.1/src/0000755000177100020040000000000011504177656015414 5ustar menesismenesiszope.app.content-3.5.1/src/zope.app.content.egg-info/0000755000177100020040000000000011504177656022313 5ustar menesismenesiszope.app.content-3.5.1/src/zope.app.content.egg-info/PKG-INFO0000644000177100020040000000255311504177654023413 0ustar menesismenesisMetadata-Version: 1.0 Name: zope.app.content Version: 3.5.1 Summary: Zope Content Type Home-page: http://cheeseshop.python.org/pypi/zope.app.content Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: This package defines an ``IInterface`` that allows the developer to mark interfaces as content types. ======= CHANGES ======= 3.5.1 (2010-12-21) ------------------ - Replace ``zope.app.component`` dependency with ``zope.componentvocabulary``. 3.5.0 (2010-09-20) ------------------ - Moved ``zope.app.interface.queryType`` to ``zope.app.content.queryType`` to inverse dependency. 3.4.0 (2007-10-11) ------------------ - Initial release independent of the main Zope tree. Keywords: zope3 content type 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.content-3.5.1/src/zope.app.content.egg-info/top_level.txt0000644000177100020040000000000511504177654025036 0ustar menesismenesiszope zope.app.content-3.5.1/src/zope.app.content.egg-info/SOURCES.txt0000644000177100020040000000110211504177654024167 0ustar menesismenesisCHANGES.txt COPYRIGHT.txt LICENSE.txt README.txt bootstrap.py buildout.cfg setup.py src/zope/__init__.py src/zope.app.content.egg-info/PKG-INFO src/zope.app.content.egg-info/SOURCES.txt src/zope.app.content.egg-info/dependency_links.txt src/zope.app.content.egg-info/namespace_packages.txt src/zope.app.content.egg-info/not-zip-safe src/zope.app.content.egg-info/requires.txt src/zope.app.content.egg-info/top_level.txt src/zope/app/__init__.py src/zope/app/content/__init__.py src/zope/app/content/configure.zcml src/zope/app/content/interfaces.py src/zope/app/content/tests.pyzope.app.content-3.5.1/src/zope.app.content.egg-info/namespace_packages.txt0000644000177100020040000000001611504177654026641 0ustar menesismenesiszope zope.app zope.app.content-3.5.1/src/zope.app.content.egg-info/not-zip-safe0000644000177100020040000000000111504177314024530 0ustar menesismenesis zope.app.content-3.5.1/src/zope.app.content.egg-info/dependency_links.txt0000644000177100020040000000000111504177654026357 0ustar menesismenesis zope.app.content-3.5.1/src/zope.app.content.egg-info/requires.txt0000644000177100020040000000014111504177654024705 0ustar menesismenesissetuptools zope.componentvocabulary zope.interface zope.schema zope.security [test] zope.testingzope.app.content-3.5.1/src/zope/0000755000177100020040000000000011504177656016371 5ustar menesismenesiszope.app.content-3.5.1/src/zope/__init__.py0000644000177100020040000000031011504177313020462 0ustar menesismenesis# 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.content-3.5.1/src/zope/app/0000755000177100020040000000000011504177656017151 5ustar menesismenesiszope.app.content-3.5.1/src/zope/app/__init__.py0000644000177100020040000000031011504177313021242 0ustar menesismenesis# 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.content-3.5.1/src/zope/app/content/0000755000177100020040000000000011504177656020623 5ustar menesismenesiszope.app.content-3.5.1/src/zope/app/content/__init__.py0000644000177100020040000000606011504177313022724 0ustar menesismenesis############################################################################## # # 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. # ############################################################################## """Content Type convenience lookup functions.""" from zope.interface import classProvides from zope.interface import providedBy from zope.schema.interfaces import IVocabularyFactory from zope.app.content.interfaces import IContentType from zope.componentvocabulary.vocabulary import UtilityVocabulary from zope.security.proxy import removeSecurityProxy def queryType(object, interface): """Returns the object's interface which implements interface. >>> from zope.interface import Interface >>> class IContentType(Interface): ... pass >>> from zope.interface import Interface, implements, directlyProvides >>> class I(Interface): ... pass >>> class J(Interface): ... pass >>> directlyProvides(I, IContentType) >>> class C(object): ... implements(I) >>> class D(object): ... implements(J,I) >>> obj = C() >>> c1_ctype = queryType(obj, IContentType) >>> c1_ctype.__name__ 'I' >>> class I1(I): ... pass >>> class I2(I1): ... pass >>> class I3(Interface): ... pass >>> class C1(object): ... implements(I1) >>> obj1 = C1() >>> c1_ctype = queryType(obj1, IContentType) >>> c1_ctype.__name__ 'I' >>> class C2(object): ... implements(I2) >>> obj2 = C2() >>> c2_ctype = queryType(obj2, IContentType) >>> c2_ctype.__name__ 'I' >>> class C3(object): ... implements(I3) >>> obj3 = C3() If Interface doesn't provide `IContentType`, `queryType` returns ``None``. >>> c3_ctype = queryType(obj3, IContentType) >>> c3_ctype >>> c3_ctype is None True >>> class I4(I): ... pass >>> directlyProvides(I4, IContentType) >>> class C4(object): ... implements(I4) >>> obj4 = C4() >>> c4_ctype = queryType(obj4, IContentType) >>> c4_ctype.__name__ 'I4' """ # Remove the security proxy, so that we can introspect the type of the # object's interfaces. naked = removeSecurityProxy(object) object_iro = providedBy(naked).__iro__ for iface in object_iro: if interface.providedBy(iface): return iface return None def queryContentType(object): """Returns the interface implemented by object which implements `IContentType`.""" return queryType(object, IContentType) class ContentTypesVocabulary(UtilityVocabulary): classProvides(IVocabularyFactory) interface = IContentType zope.app.content-3.5.1/src/zope/app/content/interfaces.py0000644000177100020040000000172511504177313023313 0ustar menesismenesis############################################################################## # # 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. # ############################################################################## """Content-related interfaces.""" __docformat__ = 'restructuredtext' from zope.interface.interfaces import IInterface class IContentType(IInterface): """This interface represents a content type. If an **interface** provides this interface type, then all objects providing the **interface** are considered content objects. """ zope.app.content-3.5.1/src/zope/app/content/configure.zcml0000644000177100020040000000036211504177313023462 0ustar menesismenesis zope.app.content-3.5.1/src/zope/app/content/tests.py0000644000177100020040000000142211504177313022324 0ustar menesismenesis############################################################################## # # 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. # ############################################################################## """Doc test harness for queryType function.""" import doctest import unittest def test_suite(): return doctest.DocTestSuite("zope.app.content") zope.app.content-3.5.1/buildout.cfg0000644000177100020040000000015211504177313017121 0ustar menesismenesis[buildout] develop = . parts = test [test] recipe = zc.recipe.testrunner eggs = zope.app.content [test]