[Checkins] SVN: zope.browser/ implemented zope.browser, including an ITerms interface definition take from zope.app.form.browser.interfaces
Roger Ineichen
roger at projekt01.ch
Wed Dec 10 21:38:56 EST 2008
Log message for revision 93866:
implemented zope.browser, including an ITerms interface definition take from zope.app.form.browser.interfaces
added buildout scripts
added tests
Changed:
A zope.browser/branches/
A zope.browser/tags/
A zope.browser/trunk/
A zope.browser/trunk/CHANGES.txt
A zope.browser/trunk/README.txt
A zope.browser/trunk/bootstrap.py
A zope.browser/trunk/buildout.cfg
A zope.browser/trunk/setup.py
A zope.browser/trunk/src/
A zope.browser/trunk/src/zope/
A zope.browser/trunk/src/zope/__init__.py
A zope.browser/trunk/src/zope/browser/
A zope.browser/trunk/src/zope/browser/README.txt
A zope.browser/trunk/src/zope/browser/__init__.py
A zope.browser/trunk/src/zope/browser/interfaces.py
A zope.browser/trunk/src/zope/browser/tests.py
-=-
Property changes on: zope.browser/trunk
___________________________________________________________________
Added: svn:ignore
+ .installed.cfg
bin
develop-eggs
parts
Added: zope.browser/trunk/CHANGES.txt
===================================================================
--- zope.browser/trunk/CHANGES.txt (rev 0)
+++ zope.browser/trunk/CHANGES.txt 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1,8 @@
+=======
+CHANGES
+=======
+
+0.5.0 (unreleased)
+------------------
+
+- Initial release
Added: zope.browser/trunk/README.txt
===================================================================
--- zope.browser/trunk/README.txt (rev 0)
+++ zope.browser/trunk/README.txt 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1 @@
+This package provides shared zope browser components without other dependencies.
Added: zope.browser/trunk/bootstrap.py
===================================================================
--- zope.browser/trunk/bootstrap.py (rev 0)
+++ zope.browser/trunk/bootstrap.py 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# 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 73733 2007-03-27 13:29:11Z 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)
Added: zope.browser/trunk/buildout.cfg
===================================================================
--- zope.browser/trunk/buildout.cfg (rev 0)
+++ zope.browser/trunk/buildout.cfg 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1,12 @@
+[buildout]
+develop = .
+parts = test py
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = zope.browser [test]
+
+[py]
+recipe = zc.recipe.egg
+eggs = zope.browser
+interpreter = py
Added: zope.browser/trunk/setup.py
===================================================================
--- zope.browser/trunk/setup.py (rev 0)
+++ zope.browser/trunk/setup.py 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1,62 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Setup for zope.browser package
+
+$Id:$
+"""
+
+import os
+
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup(name='zope.browser',
+ version = '0.5.0dev',
+ author='Zope Corporation and Contributors',
+ author_email='zope3-dev at zope.org',
+ description='Shared dependency less Zope 3 browser components',
+ long_description=(
+ read('README.txt')
+ + '\n\n' +
+ read('CHANGES.txt')
+ ),
+ license='ZPL 2.1',
+ keywords = "zope3 browser component ITerms",
+ 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.browser',
+ packages=find_packages('src'),
+ package_dir = {'': 'src'},
+ namespace_packages=['zope',],
+ extras_require = dict(
+ test=[
+ 'zope.testing',
+ ]),
+ install_requires=[
+ 'setuptools',
+ 'zope.interface',
+ ],
+ include_package_data = True,
+ zip_safe = False,
+ )
Property changes on: zope.browser/trunk/src
___________________________________________________________________
Added: svn:ignore
+ zope.browser.egg-info
Added: zope.browser/trunk/src/zope/__init__.py
===================================================================
--- zope.browser/trunk/src/zope/__init__.py (rev 0)
+++ zope.browser/trunk/src/zope/__init__.py 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1,7 @@
+# this is a namespace package
+try:
+ import pkg_resources
+ pkg_resources.declare_namespace(__name__)
+except ImportError:
+ import pkgutil
+ __path__ = pkgutil.extend_path(__path__, __name__)
Added: zope.browser/trunk/src/zope/browser/README.txt
===================================================================
--- zope.browser/trunk/src/zope/browser/README.txt (rev 0)
+++ zope.browser/trunk/src/zope/browser/README.txt 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1,23 @@
+======
+README
+======
+
+This package provides shared browser components for Zope 3.
+
+
+ITerms
+------
+
+The ITerms interface is used as a base for ISource widget implementations. This
+interfaces get used by zope.app.form and was initially defined in
+zope.app.form.browser.interfaces.py. This makes it impossible to use for other
+packages like z3c.form wihtout to depend on zope.app.form. Moving such base
+components or interfaces to zope.browser will make it possible to share such
+base components.
+
+There is not much we can test except that ITerms is importable and an interface:
+
+ >>> import zope.interface
+ >>> from zope.browser import interfaces
+ >>> zope.interface.Interface.providedBy(interfaces.ITerms)
+ True
Added: zope.browser/trunk/src/zope/browser/__init__.py
===================================================================
--- zope.browser/trunk/src/zope/browser/__init__.py (rev 0)
+++ zope.browser/trunk/src/zope/browser/__init__.py 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1 @@
+# make a package
Added: zope.browser/trunk/src/zope/browser/interfaces.py
===================================================================
--- zope.browser/trunk/src/zope/browser/interfaces.py (rev 0)
+++ zope.browser/trunk/src/zope/browser/interfaces.py 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Shared dependency less Zope3 brwoser components.
+
+$Id:$
+"""
+
+import zope.interface
+
+__docformat__ = 'restructuredtext'
+
+
+class ITerms(zope.interface.Interface):
+
+ def getTerm(value):
+ """Return an ITitledTokenizedTerm object for the given value
+
+ LookupError is raised if the value isn't in the source
+ """
+
+ def getValue(token):
+ """Return a value for a given identifier token
+
+ LookupError is raised if there isn't a value in the source.
+ """
Added: zope.browser/trunk/src/zope/browser/tests.py
===================================================================
--- zope.browser/trunk/src/zope/browser/tests.py (rev 0)
+++ zope.browser/trunk/src/zope/browser/tests.py 2008-12-11 02:38:56 UTC (rev 93866)
@@ -0,0 +1,32 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id:$
+"""
+__docformat__ = "reStructuredText"
+
+import unittest
+from zope.testing import doctest
+
+
+def test_suite():
+ return unittest.TestSuite((
+ doctest.DocFileSuite('README.txt',
+ optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
+ ),
+ ))
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
More information about the Checkins
mailing list