zope.componentvocabulary-1.0.1/ 000755 000766 000024 00000000000 11450302217 016456 5 ustar 00mac staff 000000 000000 zope.componentvocabulary-1.0.1/CHANGES.txt 000644 000766 000024 00000000530 11450302177 020272 0 ustar 00mac staff 000000 000000 =======
CHANGES
=======
1.0.1 (2010-09-25)
------------------
- Added not declared but needed dependency on ``zope.component``.
- Added test extra to declare test dependency on ``zope.component [test]``.
1.0 (2009-05-19)
----------------
* Initial public release, derived from zope.app.component and
zope.app.interface to replace them.
zope.componentvocabulary-1.0.1/COPYRIGHT.txt 000644 000766 000024 00000000040 11446133170 020566 0 ustar 00mac staff 000000 000000 Zope Foundation and Contributors zope.componentvocabulary-1.0.1/LICENSE.txt 000644 000766 000024 00000004026 11446133170 020310 0 ustar 00mac staff 000000 000000 Zope 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.componentvocabulary-1.0.1/PKG-INFO 000644 000766 000024 00000002412 11450302217 017552 0 ustar 00mac staff 000000 000000 Metadata-Version: 1.0
Name: zope.componentvocabulary
Version: 1.0.1
Summary: Component vocabularies
Home-page: http://pypi.python.org/pypi/zope.componentvocabulary
Author: Zope Foundation and Contributors
Author-email: zope-dev@zope.org
License: ZPL 2.1
Description: This package contains various vocabularies.
=======
CHANGES
=======
1.0.1 (2010-09-25)
------------------
- Added not declared but needed dependency on ``zope.component``.
- Added test extra to declare test dependency on ``zope.component [test]``.
1.0 (2009-05-19)
----------------
* Initial public release, derived from zope.app.component and
zope.app.interface to replace them.
Keywords: zope component architecture vocabulary
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.componentvocabulary-1.0.1/README.txt 000644 000766 000024 00000000054 11446133170 020160 0 ustar 00mac staff 000000 000000 This package contains various vocabularies.
zope.componentvocabulary-1.0.1/bootstrap.py 000644 000766 000024 00000003302 11446133170 021050 0 ustar 00mac staff 000000 000000 ##############################################################################
#
# 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.componentvocabulary-1.0.1/buildout.cfg 000644 000766 000024 00000000627 11447364327 021013 0 ustar 00mac staff 000000 000000 [buildout]
develop = .
parts = test coverage-test coverage-report
[test]
recipe = zc.recipe.testrunner
eggs = zope.componentvocabulary [test]
[coverage-test]
recipe = zc.recipe.testrunner
eggs = zope.componentvocabulary
defaults = ['--coverage', '../../coverage']
[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coverage=coverage-report
arguments = ('coverage', 'coverage/report')
zope.componentvocabulary-1.0.1/setup.cfg 000644 000766 000024 00000000073 11450302217 020277 0 ustar 00mac staff 000000 000000 [egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
zope.componentvocabulary-1.0.1/setup.py 000644 000766 000024 00000004220 11450302177 020173 0 ustar 00mac staff 000000 000000 ##############################################################################
#
# 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.
#
##############################################################################
"""Setup for zope.app.catalog 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.componentvocabulary',
version='1.0.1',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
description='Component vocabularies',
long_description=(
read('README.txt')
+ '\n\n' +
read('CHANGES.txt')
),
keywords="zope component architecture vocabulary",
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.componentvocabulary',
license='ZPL 2.1',
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['zope'],
install_requires=[
'setuptools',
'zope.component',
'zope.i18nmessageid',
'zope.interface',
'zope.schema',
'zope.security',
],
extras_require=dict(
test=[
'zope.component [test]',
]),
include_package_data=True,
zip_safe=False,
)
zope.componentvocabulary-1.0.1/src/ 000755 000766 000024 00000000000 11450302217 017245 5 ustar 00mac staff 000000 000000 zope.componentvocabulary-1.0.1/src/zope/ 000755 000766 000024 00000000000 11450302217 020222 5 ustar 00mac staff 000000 000000 zope.componentvocabulary-1.0.1/src/zope.componentvocabulary.egg-info/ 000755 000766 000024 00000000000 11450302217 026005 5 ustar 00mac staff 000000 000000 zope.componentvocabulary-1.0.1/src/zope.componentvocabulary.egg-info/PKG-INFO 000644 000766 000024 00000002412 11450302216 027100 0 ustar 00mac staff 000000 000000 Metadata-Version: 1.0
Name: zope.componentvocabulary
Version: 1.0.1
Summary: Component vocabularies
Home-page: http://pypi.python.org/pypi/zope.componentvocabulary
Author: Zope Foundation and Contributors
Author-email: zope-dev@zope.org
License: ZPL 2.1
Description: This package contains various vocabularies.
=======
CHANGES
=======
1.0.1 (2010-09-25)
------------------
- Added not declared but needed dependency on ``zope.component``.
- Added test extra to declare test dependency on ``zope.component [test]``.
1.0 (2009-05-19)
----------------
* Initial public release, derived from zope.app.component and
zope.app.interface to replace them.
Keywords: zope component architecture vocabulary
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.componentvocabulary-1.0.1/src/zope.componentvocabulary.egg-info/SOURCES.txt 000644 000766 000024 00000001345 11450302216 027673 0 ustar 00mac staff 000000 000000 CHANGES.txt
COPYRIGHT.txt
LICENSE.txt
README.txt
bootstrap.py
buildout.cfg
setup.py
src/zope/__init__.py
src/zope.componentvocabulary.egg-info/PKG-INFO
src/zope.componentvocabulary.egg-info/SOURCES.txt
src/zope.componentvocabulary.egg-info/dependency_links.txt
src/zope.componentvocabulary.egg-info/namespace_packages.txt
src/zope.componentvocabulary.egg-info/not-zip-safe
src/zope.componentvocabulary.egg-info/requires.txt
src/zope.componentvocabulary.egg-info/top_level.txt
src/zope/componentvocabulary/__init__.py
src/zope/componentvocabulary/configure.zcml
src/zope/componentvocabulary/i18n.py
src/zope/componentvocabulary/vocabulary.py
src/zope/componentvocabulary/tests/__init__.py
src/zope/componentvocabulary/tests/test_vocabulary.py zope.componentvocabulary-1.0.1/src/zope.componentvocabulary.egg-info/dependency_links.txt 000644 000766 000024 00000000001 11450302216 032052 0 ustar 00mac staff 000000 000000
zope.componentvocabulary-1.0.1/src/zope.componentvocabulary.egg-info/namespace_packages.txt 000644 000766 000024 00000000005 11450302216 032332 0 ustar 00mac staff 000000 000000 zope
zope.componentvocabulary-1.0.1/src/zope.componentvocabulary.egg-info/not-zip-safe 000644 000766 000024 00000000001 11446133205 030237 0 ustar 00mac staff 000000 000000
zope.componentvocabulary-1.0.1/src/zope.componentvocabulary.egg-info/requires.txt 000644 000766 000024 00000000163 11450302216 030404 0 ustar 00mac staff 000000 000000 setuptools
zope.component
zope.i18nmessageid
zope.interface
zope.schema
zope.security
[test]
zope.component [test] zope.componentvocabulary-1.0.1/src/zope.componentvocabulary.egg-info/top_level.txt 000644 000766 000024 00000000005 11450302216 030531 0 ustar 00mac staff 000000 000000 zope
zope.componentvocabulary-1.0.1/src/zope/__init__.py 000644 000766 000024 00000000311 11446133170 022333 0 ustar 00mac staff 000000 000000 # 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.componentvocabulary-1.0.1/src/zope/componentvocabulary/ 000755 000766 000024 00000000000 11450302217 024314 5 ustar 00mac staff 000000 000000 zope.componentvocabulary-1.0.1/src/zope/componentvocabulary/__init__.py 000644 000766 000024 00000001233 11446133170 026431 0 ustar 00mac staff 000000 000000 ##############################################################################
#
# 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.
#
##############################################################################
"""Component vocabularies.
"""
zope.componentvocabulary-1.0.1/src/zope/componentvocabulary/configure.zcml 000644 000766 000024 00000001256 11446133170 027175 0 ustar 00mac staff 000000 000000
zope.componentvocabulary-1.0.1/src/zope/componentvocabulary/i18n.py 000644 000766 000024 00000001572 11446133170 025457 0 ustar 00mac staff 000000 000000 ##############################################################################
#
# 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.componentvocabulary-1.0.1/src/zope/componentvocabulary/tests/ 000755 000766 000024 00000000000 11450302217 025456 5 ustar 00mac staff 000000 000000 zope.componentvocabulary-1.0.1/src/zope/componentvocabulary/vocabulary.py 000644 000766 000024 00000033101 11446133170 027040 0 ustar 00mac staff 000000 000000 ##############################################################################
#
# 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.
#
##############################################################################
"""Utility Vocabulary.
This vocabulary provides terms for all utilities providing a given interface.
"""
__docformat__ = "reStructuredText"
import zope.component
from zope.component.interface import interfaceToName
from zope.component.interfaces import IUtilityRegistration
from zope.interface import implements, classProvides, Interface, providedBy
from zope.interface.interfaces import IInterface
from zope.security.proxy import removeSecurityProxy
from zope.schema.interfaces import IVocabularyTokenized
from zope.schema.interfaces import ITokenizedTerm, ITitledTokenizedTerm
from zope.schema.interfaces import IVocabularyFactory
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from zope.componentvocabulary.i18n import ZopeMessageFactory as _
class UtilityTerm(object):
"""A term representing a utility.
The token of the term is the name of the utility. Here is a brief example
on how the IVocabulary interface is handled in this term as a
utility:
>>> from zope.interface.verify import verifyObject
>>> from zope.schema.interfaces import IVocabulary
>>> term = UtilityTerm(IVocabulary, 'zope.schema.interfaces.IVocabulary')
>>> verifyObject(ITokenizedTerm, term)
True
>>> term.value
>>> term.token
'zope.schema.interfaces.IVocabulary'
>>> term
"""
implements(ITokenizedTerm)
def __init__(self, value, token):
"""Create a term for value and token."""
self.value = value
self.token = token
def __repr__(self):
return '' %(
self.token, self.value.__class__.__name__)
class UtilityVocabulary(object):
"""Vocabulary that provides utilities of a specified interface.
Here is a short example of how the vocabulary should work.
First we need to create a utility interface and some utilities:
>>> class IObject(Interface):
... 'Simple interface to mark object utilities.'
>>>
>>> class Object(object):
... implements(IObject)
... def __init__(self, name):
... self.name = name
... def __repr__(self):
... return '