zope.app.schema-3.5.0/0000755000175000017500000000000011121665563012714 5ustar nyonyozope.app.schema-3.5.0/setup.cfg0000644000175000017500000000007311121665563014535 0ustar nyonyo[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 zope.app.schema-3.5.0/PKG-INFO0000644000175000017500000000471111121665563014014 0ustar nyonyoMetadata-Version: 1.0 Name: zope.app.schema Version: 3.5.0 Summary: Component Architecture based Vocabulary Registry Home-page: http://pypi.python.org/pypi/zope.app.schema Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: This package provides a component architecture based vocabulary registry. Component-based Vocabulary Registry =================================== This package provides a vocabulary registry for zope.schema, based on the component architecture. It replaces the zope.schema's simple vocabulary registry when ``zope.app.schema`` package is imported, so it's done automatically. All we need is provide vocabulary factory utilities: >>> from zope.component import provideUtility >>> from zope.schema.interfaces import IVocabularyFactory >>> from zope.schema.vocabulary import SimpleTerm >>> from zope.schema.vocabulary import SimpleVocabulary >>> def SomeVocabulary(context=None): ... terms = [SimpleTerm(1), SimpleTerm(2)] ... return SimpleVocabulary(terms) >>> provideUtility(SomeVocabulary, IVocabularyFactory, ... name='SomeVocabulary') Now we can get the vocabulary using standard zope.schema way: >>> from zope.schema.vocabulary import getVocabularyRegistry >>> vr = getVocabularyRegistry() >>> voc = vr.get(None, 'SomeVocabulary') >>> [term.value for term in voc] [1, 2] ======= CHANGES ======= 3.5.0 (2008-12-16) ------------------ - Remove deprecated ``vocabulary`` directive. - Add test for component-based vocabulary registry. 3.4.0 (2007-10-27) ------------------ - Initial release independent of the main Zope tree. Keywords: zope3 vocabulary registry local component Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.app.schema-3.5.0/src/0000755000175000017500000000000011121665563013503 5ustar nyonyozope.app.schema-3.5.0/src/zope.app.schema.egg-info/0000755000175000017500000000000011121665563020170 5ustar nyonyozope.app.schema-3.5.0/src/zope.app.schema.egg-info/PKG-INFO0000644000175000017500000000471111121665561021266 0ustar nyonyoMetadata-Version: 1.0 Name: zope.app.schema Version: 3.5.0 Summary: Component Architecture based Vocabulary Registry Home-page: http://pypi.python.org/pypi/zope.app.schema Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: This package provides a component architecture based vocabulary registry. Component-based Vocabulary Registry =================================== This package provides a vocabulary registry for zope.schema, based on the component architecture. It replaces the zope.schema's simple vocabulary registry when ``zope.app.schema`` package is imported, so it's done automatically. All we need is provide vocabulary factory utilities: >>> from zope.component import provideUtility >>> from zope.schema.interfaces import IVocabularyFactory >>> from zope.schema.vocabulary import SimpleTerm >>> from zope.schema.vocabulary import SimpleVocabulary >>> def SomeVocabulary(context=None): ... terms = [SimpleTerm(1), SimpleTerm(2)] ... return SimpleVocabulary(terms) >>> provideUtility(SomeVocabulary, IVocabularyFactory, ... name='SomeVocabulary') Now we can get the vocabulary using standard zope.schema way: >>> from zope.schema.vocabulary import getVocabularyRegistry >>> vr = getVocabularyRegistry() >>> voc = vr.get(None, 'SomeVocabulary') >>> [term.value for term in voc] [1, 2] ======= CHANGES ======= 3.5.0 (2008-12-16) ------------------ - Remove deprecated ``vocabulary`` directive. - Add test for component-based vocabulary registry. 3.4.0 (2007-10-27) ------------------ - Initial release independent of the main Zope tree. Keywords: zope3 vocabulary registry local component Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.app.schema-3.5.0/src/zope.app.schema.egg-info/namespace_packages.txt0000644000175000017500000000001611121665561024516 0ustar nyonyozope zope.app zope.app.schema-3.5.0/src/zope.app.schema.egg-info/SOURCES.txt0000644000175000017500000000121511121665561022051 0ustar nyonyoCHANGES.txt README.txt bootstrap.py buildout.cfg setup.py src/zope/__init__.py src/zope.app.schema.egg-info/PKG-INFO src/zope.app.schema.egg-info/SOURCES.txt src/zope.app.schema.egg-info/dependency_links.txt src/zope.app.schema.egg-info/namespace_packages.txt src/zope.app.schema.egg-info/not-zip-safe src/zope.app.schema.egg-info/requires.txt src/zope.app.schema.egg-info/top_level.txt src/zope/app/__init__.py src/zope/app/schema/README.txt src/zope/app/schema/SETUP.cfg src/zope/app/schema/__init__.py src/zope/app/schema/configure.zcml src/zope/app/schema/tests.py src/zope/app/schema/vocabulary.py src/zope/app/schema/zope.app.schema-configure.zcmlzope.app.schema-3.5.0/src/zope.app.schema.egg-info/not-zip-safe0000644000175000017500000000000111121664413022407 0ustar nyonyo zope.app.schema-3.5.0/src/zope.app.schema.egg-info/top_level.txt0000644000175000017500000000000511121665561022713 0ustar nyonyozope zope.app.schema-3.5.0/src/zope.app.schema.egg-info/requires.txt0000644000175000017500000000011511121665561022563 0ustar nyonyosetuptools zope.component zope.interface zope.schema [test] zope.app.testingzope.app.schema-3.5.0/src/zope.app.schema.egg-info/dependency_links.txt0000644000175000017500000000000111121665561024234 0ustar nyonyo zope.app.schema-3.5.0/src/zope/0000755000175000017500000000000011121665563014460 5ustar nyonyozope.app.schema-3.5.0/src/zope/app/0000755000175000017500000000000011121665563015240 5ustar nyonyozope.app.schema-3.5.0/src/zope/app/schema/0000755000175000017500000000000011121665563016500 5ustar nyonyozope.app.schema-3.5.0/src/zope/app/schema/zope.app.schema-configure.zcml0000644000175000017500000000004611121664333024333 0ustar nyonyo zope.app.schema-3.5.0/src/zope/app/schema/configure.zcml0000644000175000017500000001644111121664333021350 0ustar nyonyo zope.app.schema-3.5.0/src/zope/app/schema/tests.py0000644000175000017500000000076311121664333020214 0ustar nyonyoimport unittest from zope.testing import doctest from zope.app.testing import setup from zope.app.schema.vocabulary import _clear def setUp(test): setup.placefulSetUp() _clear() def tearDown(test): setup.placefulTearDown() def test_suite(): return unittest.TestSuite(( doctest.DocFileSuite('README.txt', setUp=setUp, tearDown=tearDown, optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS, ), )) zope.app.schema-3.5.0/src/zope/app/schema/SETUP.cfg0000644000175000017500000000017611121664333020057 0ustar nyonyo# Tell zpkg how to install the ZCML slugs. zope.app.schema-*.zcml zope.app.schema-3.5.0/src/zope/app/schema/vocabulary.py0000644000175000017500000000345011121664333021215 0ustar nyonyo############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Implementation of ZCML action to register vocabulary factories. $Id: vocabulary.py 73667 2007-03-27 07:25:21Z dobe $ """ import zope.component from zope.interface import implements from zope.schema.interfaces import IVocabularyRegistry from zope.schema import vocabulary from zope.schema.interfaces import IVocabularyFactory class ZopeVocabularyRegistry(object): """IVocabularyRegistry that supports global and local utilities.""" implements(IVocabularyRegistry) __slots__ = () def get(self, context, name): """See zope.schema.interfaces.IVocabularyRegistry""" factory = zope.component.getUtility(IVocabularyFactory, name) return factory(context) def _clear(): """Re-initialize the vocabulary registry.""" # This should normally only be needed by the testing framework, # but is also used for module initialization. global vocabularyRegistry vocabulary._clear() vocabularyRegistry = vocabulary.getVocabularyRegistry() vocabulary._clear() vocabulary.setVocabularyRegistry(ZopeVocabularyRegistry()) _clear() try: from zope.testing import cleanup except ImportError: pass else: cleanup.addCleanUp(_clear) zope.app.schema-3.5.0/src/zope/app/schema/README.txt0000644000175000017500000000204211121664333020166 0ustar nyonyoComponent-based Vocabulary Registry =================================== This package provides a vocabulary registry for zope.schema, based on the component architecture. It replaces the zope.schema's simple vocabulary registry when ``zope.app.schema`` package is imported, so it's done automatically. All we need is provide vocabulary factory utilities: >>> from zope.component import provideUtility >>> from zope.schema.interfaces import IVocabularyFactory >>> from zope.schema.vocabulary import SimpleTerm >>> from zope.schema.vocabulary import SimpleVocabulary >>> def SomeVocabulary(context=None): ... terms = [SimpleTerm(1), SimpleTerm(2)] ... return SimpleVocabulary(terms) >>> provideUtility(SomeVocabulary, IVocabularyFactory, ... name='SomeVocabulary') Now we can get the vocabulary using standard zope.schema way: >>> from zope.schema.vocabulary import getVocabularyRegistry >>> vr = getVocabularyRegistry() >>> voc = vr.get(None, 'SomeVocabulary') >>> [term.value for term in voc] [1, 2]zope.app.schema-3.5.0/src/zope/app/schema/__init__.py0000644000175000017500000000150211121664333020601 0ustar nyonyo############################################################################## # # Copyright (c) 2006 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Schemas $Id: __init__.py 66068 2006-03-19 16:27:42Z philikon $ """ # we want to hook-up our own vocabulary registry; importing the module # is enough for that import zope.app.schema.vocabulary zope.app.schema-3.5.0/src/zope/app/__init__.py0000644000175000017500000000031011121664333017335 0ustar nyonyo# 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.schema-3.5.0/src/zope/__init__.py0000644000175000017500000000031011121664333016555 0ustar nyonyo# 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.schema-3.5.0/bootstrap.py0000644000175000017500000000337011121664333015300 0ustar nyonyo############################################################################## # # Copyright (c) 2006 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Bootstrap a buildout-based project Simply run this script in a directory containing a buildout.cfg. The script accepts buildout command-line options, so you can use the -c option to specify an alternate configuration file. $Id: bootstrap.py 73666 2007-03-27 07:20:45Z dobe $ """ 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.schema-3.5.0/setup.py0000644000175000017500000000437511121665472014436 0ustar nyonyo############################################################################## # # Copyright (c) 2006 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Setup for zope.app.schema package $Id: setup.py 94103 2008-12-16 08:40:10Z nadako $ """ 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.schema', version = '3.5.0', author='Zope Corporation and Contributors', author_email='zope-dev@zope.org', description='Component Architecture based Vocabulary Registry', long_description=( read('README.txt') + '\n\n' + read('src', 'zope', 'app', 'schema', 'README.txt') + '\n\n' + read('CHANGES.txt') ), keywords = "zope3 vocabulary registry local component", classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Zope Public License', 'Programming Language :: Python', 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Internet :: WWW/HTTP', 'Framework :: Zope3'], url='http://pypi.python.org/pypi/zope.app.schema', license='ZPL 2.1', packages=find_packages('src'), package_dir = {'': 'src'}, namespace_packages=['zope', 'zope.app'], extras_require = dict(test=['zope.app.testing']), install_requires=['setuptools', 'zope.component', 'zope.interface', 'zope.schema', ], include_package_data = True, zip_safe = False, ) zope.app.schema-3.5.0/README.txt0000644000175000017500000000011211121664333014376 0ustar nyonyoThis package provides a component architecture based vocabulary registry. zope.app.schema-3.5.0/CHANGES.txt0000644000175000017500000000037711121664333014526 0ustar nyonyo======= CHANGES ======= 3.5.0 (2008-12-16) ------------------ - Remove deprecated ``vocabulary`` directive. - Add test for component-based vocabulary registry. 3.4.0 (2007-10-27) ------------------ - Initial release independent of the main Zope tree. zope.app.schema-3.5.0/buildout.cfg0000644000175000017500000000061411121664333015217 0ustar nyonyo[buildout] develop = . parts = test coverage-test coverage-report [test] recipe = zc.recipe.testrunner eggs = zope.app.schema [test] [coverage-test] recipe = zc.recipe.testrunner eggs = zope.app.schema [test] defaults = ['--coverage', '../../coverage'] [coverage-report] recipe = zc.recipe.egg eggs = z3c.coverage scripts = coverage=coverage-report arguments = ('coverage', 'coverage/report')