[Checkins] SVN: z3c.iban/ Initial Release of IBAN widget
Hermann Himmelbauer
dusty at qwer.tk
Tue Nov 4 12:14:07 EST 2008
Log message for revision 92776:
Initial Release of IBAN widget
Changed:
A z3c.iban/
A z3c.iban/branches/
A z3c.iban/tags/
A z3c.iban/trunk/
A z3c.iban/trunk/AUTHOR.txt
A z3c.iban/trunk/CHANGES.txt
A z3c.iban/trunk/LICENSE.txt
A z3c.iban/trunk/README.txt
A z3c.iban/trunk/TODOS.txt
A z3c.iban/trunk/bootstrap.py
A z3c.iban/trunk/buildout.cfg
A z3c.iban/trunk/setup.py
A z3c.iban/trunk/src/
A z3c.iban/trunk/src/z3c/
A z3c.iban/trunk/src/z3c/__init__.py
A z3c.iban/trunk/src/z3c/iban/
A z3c.iban/trunk/src/z3c/iban/README.txt
A z3c.iban/trunk/src/z3c/iban/SETUP.cfg
A z3c.iban/trunk/src/z3c/iban/__init__.py
A z3c.iban/trunk/src/z3c/iban/configure.zcml
A z3c.iban/trunk/src/z3c/iban/field.py
A z3c.iban/trunk/src/z3c/iban/i18n.py
A z3c.iban/trunk/src/z3c/iban/interfaces.py
A z3c.iban/trunk/src/z3c/iban/tests.py
A z3c.iban/trunk/src/z3c/iban/z3c.iban-configure.zcml
-=-
Added: z3c.iban/trunk/AUTHOR.txt
===================================================================
--- z3c.iban/trunk/AUTHOR.txt (rev 0)
+++ z3c.iban/trunk/AUTHOR.txt 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,4 @@
+Hermann Himmelbauer (dusty |at| qwer.tk)
+
+Thanks goes to ACT, the Austrian Center of Training Firms for supporting
+this work.
Added: z3c.iban/trunk/CHANGES.txt
===================================================================
--- z3c.iban/trunk/CHANGES.txt (rev 0)
+++ z3c.iban/trunk/CHANGES.txt 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,10 @@
+=======
+CHANGES
+=======
+
+Version 0.1.0 (04/11/2008)
+-------------------------
+
+- Initial Release
+
+ * Implementation of ``IBAN`` field.
Added: z3c.iban/trunk/LICENSE.txt
===================================================================
--- z3c.iban/trunk/LICENSE.txt (rev 0)
+++ z3c.iban/trunk/LICENSE.txt 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,54 @@
+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.
Added: z3c.iban/trunk/README.txt
===================================================================
--- z3c.iban/trunk/README.txt (rev 0)
+++ z3c.iban/trunk/README.txt 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,2 @@
+A package implementing an IBAN field for ``zope.schema`` and support for
+using the field with ``z3c.form``.
Added: z3c.iban/trunk/TODOS.txt
===================================================================
--- z3c.iban/trunk/TODOS.txt (rev 0)
+++ z3c.iban/trunk/TODOS.txt 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,3 @@
+=====
+TODOS
+=====
Added: z3c.iban/trunk/bootstrap.py
===================================================================
--- z3c.iban/trunk/bootstrap.py (rev 0)
+++ z3c.iban/trunk/bootstrap.py 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2007 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 77083 2007-06-25 22:56:42Z srichter $
+"""
+
+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: z3c.iban/trunk/buildout.cfg
===================================================================
--- z3c.iban/trunk/buildout.cfg (rev 0)
+++ z3c.iban/trunk/buildout.cfg 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,7 @@
+[buildout]
+develop = .
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = z3c.iban [test]
Added: z3c.iban/trunk/setup.py
===================================================================
--- z3c.iban/trunk/setup.py (rev 0)
+++ z3c.iban/trunk/setup.py 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,72 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""Setup
+
+$Id: setup.py 79605 2007-09-12 21:54:41Z hermann $
+"""
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__),
+ *rnames)).read().decode('utf-8').encode('latin-1', 'ignore')
+
+setup (
+ name='z3c.iban',
+ version='0.1.0',
+ author = "Hermann Himmelbauer",
+ author_email = "dusty at qwer.tk",
+ description = "An IBAN field and support for ``z3c.form``.",
+ long_description=(
+ read('README.txt')
+ + '\n\n' +
+ 'Detailed Documentation\n'
+ '**********************\n'
+ + '\n' +
+ read('src', 'z3c', 'iban', 'README.txt')
+ + '\n\n' +
+ read('CHANGES.txt')
+ ),
+ license = "ZPL 2.1",
+ keywords = "zope3 IBAN schema field widget form",
+ classifiers = [
+ 'Development Status :: 2 - Beta',
+ '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://svn.zope.org/z3c.iban',
+ packages = find_packages('src'),
+ include_package_data = True,
+ package_dir = {'':'src'},
+ namespace_packages = ['z3c'],
+ extras_require = dict(
+ test = ['z3c.form', 'zope.testing'],
+ form = ['z3c.form'],
+ ),
+ install_requires = [
+ 'setuptools',
+ 'ibanlib',
+ 'zope.i18n',
+ 'zope.i18nmessageid',
+ 'zope.interface',
+ 'zope.schema',
+ ],
+ dependency_links = ['http://download.zope.org/distribution'],
+ zip_safe = False,
+ )
Added: z3c.iban/trunk/src/z3c/__init__.py
===================================================================
--- z3c.iban/trunk/src/z3c/__init__.py (rev 0)
+++ z3c.iban/trunk/src/z3c/__init__.py 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,7 @@
+try:
+ # Declare this a namespace package if pkg_resources is available.
+ import pkg_resources
+ pkg_resources.declare_namespace('z3c')
+except ImportError:
+ pass
+
Added: z3c.iban/trunk/src/z3c/iban/README.txt
===================================================================
--- z3c.iban/trunk/src/z3c/iban/README.txt (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/README.txt 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,19 @@
+==================
+The Currency Field
+==================
+
+The IBAN field is a textual field, specifically designed to hold
+the international bank account number (IBAN).
+
+ >>> from z3c.iban import field, interfaces
+
+ >>> iban1 = field.IBAN(
+ ... title=u'IBAN 1',
+ ... description=u'IBAN Number 1')
+
+Now the field can be validated.
+
+ >>> iban1.validate('UNKNOWNIBAN')
+ Traceback (most recent call last):
+ ...
+ ValidationError: Value is no valid IBAN
Added: z3c.iban/trunk/src/z3c/iban/SETUP.cfg
===================================================================
--- z3c.iban/trunk/src/z3c/iban/SETUP.cfg (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/SETUP.cfg 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,4 @@
+<data-files zopeskel/etc/package-includes>
+ z3c.iban-*.zcml
+</data-files>
+
Added: z3c.iban/trunk/src/z3c/iban/__init__.py
===================================================================
--- z3c.iban/trunk/src/z3c/iban/__init__.py (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/__init__.py 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1 @@
+# Make a package
Added: z3c.iban/trunk/src/z3c/iban/configure.zcml
===================================================================
--- z3c.iban/trunk/src/z3c/iban/configure.zcml (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/configure.zcml 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,12 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope">
+
+ <adapter
+ factory="z3c.form.browser.text.TextFieldWidget"
+ for="z3c.iban.interfaces.IIBAN
+ z3c.form.interfaces.IFormLayer"
+ />
+
+
+</configure>
+
Added: z3c.iban/trunk/src/z3c/iban/field.py
===================================================================
--- z3c.iban/trunk/src/z3c/iban/field.py (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/field.py 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,37 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""IBAN Field implementation
+
+$Id: field.py 78339 2007-07-25 22:55:36Z hermann $
+"""
+
+__docformat__ = "reStructuredText"
+
+from ibanlib.iban import valid
+
+import zope.interface
+import zope.schema
+from zope.schema.fieldproperty import FieldProperty
+
+from z3c.iban import interfaces
+
+class IBAN(zope.schema.Orderable, zope.schema.Field):
+ zope.interface.implements(interfaces.IIBAN)
+
+ def _validate(self, value):
+ if not valid(value):
+ raise zope.schema.ValidationError(
+ "Value is no valid IBAN")
+ super(IBAN, self)._validate(value)
+
Added: z3c.iban/trunk/src/z3c/iban/i18n.py
===================================================================
--- z3c.iban/trunk/src/z3c/iban/i18n.py (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/i18n.py 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,22 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""I18n message factory z3c.iban
+
+$Id: i18n.py 77083 2007-06-25 22:56:42Z hermann $
+"""
+__docformat__ = "reStructuredText"
+
+import zope.i18nmessageid
+
+MessageFactory = zope.i18nmessageid.MessageFactory('z3c.iban')
Added: z3c.iban/trunk/src/z3c/iban/interfaces.py
===================================================================
--- z3c.iban/trunk/src/z3c/iban/interfaces.py (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/interfaces.py 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""IBAN Field interfaces
+
+$Id: interfaces.py 77083 2007-06-25 22:56:42Z hermann $
+"""
+__docformat__ = "reStructuredText"
+import zope.schema
+from zope.schema import interfaces
+
+from z3c.iban.i18n import MessageFactory as _
+
+class IIBAN(interfaces.IField):
+ """IBAN Field"""
Added: z3c.iban/trunk/src/z3c/iban/tests.py
===================================================================
--- z3c.iban/trunk/src/z3c/iban/tests.py (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/tests.py 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1,32 @@
+##############################################################################
+#
+# Copyright (c) 2005 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.
+#
+##############################################################################
+"""IBAN Test Setup
+
+$Id: tests.py 77083 2007-06-25 22:56:42Z hermann $
+"""
+__docformat__ = "reStructuredText"
+
+import unittest
+from zope.testing import doctest
+from zope.testing.doctestunit import DocFileSuite
+
+def test_suite():
+ return unittest.TestSuite((
+ DocFileSuite('README.txt',
+ optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
+ ),
+ ))
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
Added: z3c.iban/trunk/src/z3c/iban/z3c.iban-configure.zcml
===================================================================
--- z3c.iban/trunk/src/z3c/iban/z3c.iban-configure.zcml (rev 0)
+++ z3c.iban/trunk/src/z3c/iban/z3c.iban-configure.zcml 2008-11-04 17:14:06 UTC (rev 92776)
@@ -0,0 +1 @@
+<include package="z3c.iban" />
More information about the Checkins
mailing list