[Checkins] SVN: zope.app.pagetemplate/trunk/ Move tales:expressiontype to zope.browserpage.
Martijn Faassen
faassen at startifact.com
Mon Apr 26 11:59:42 EDT 2010
Log message for revision 111432:
Move tales:expressiontype to zope.browserpage.
Changed:
U zope.app.pagetemplate/trunk/CHANGES.txt
U zope.app.pagetemplate/trunk/setup.py
U zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/meta.zcml
U zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/metaconfigure.py
D zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/tests/test_directives.py
-=-
Modified: zope.app.pagetemplate/trunk/CHANGES.txt
===================================================================
--- zope.app.pagetemplate/trunk/CHANGES.txt 2010-04-26 15:59:30 UTC (rev 111431)
+++ zope.app.pagetemplate/trunk/CHANGES.txt 2010-04-26 15:59:42 UTC (rev 111432)
@@ -2,12 +2,11 @@
Changes
=======
-3.10.2 (unreleased)
+3.11 (unreleased)
-------------------
-- Nothing changed yet.
+- Move tales:expressiontype directive down into zope.browserpage.
-
3.10.1 (2010-01-04)
-------------------
Modified: zope.app.pagetemplate/trunk/setup.py
===================================================================
--- zope.app.pagetemplate/trunk/setup.py 2010-04-26 15:59:30 UTC (rev 111431)
+++ zope.app.pagetemplate/trunk/setup.py 2010-04-26 15:59:42 UTC (rev 111432)
@@ -49,7 +49,7 @@
include_package_data=True,
install_requires=[
'setuptools',
- 'zope.browserpage>=3.11.0',
+ 'zope.browserpage>=3.12.0',
'zope.component [hook]',
'zope.configuration',
'zope.dublincore',
Modified: zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/meta.zcml
===================================================================
--- zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/meta.zcml 2010-04-26 15:59:30 UTC (rev 111431)
+++ zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/meta.zcml 2010-04-26 15:59:42 UTC (rev 111432)
@@ -3,13 +3,6 @@
xmlns:meta="http://namespaces.zope.org/meta"
>
- <meta:directives namespace="http://namespaces.zope.org/tales">
+<!-- BBB -->
- <meta:directive name="expressiontype"
- schema=".metaconfigure.IExpressionTypeDirective"
- handler=".metaconfigure.expressiontype"
- />
-
- </meta:directives>
-
</configure>
Modified: zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/metaconfigure.py
===================================================================
--- zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/metaconfigure.py 2010-04-26 15:59:30 UTC (rev 111431)
+++ zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/metaconfigure.py 2010-04-26 15:59:42 UTC (rev 111432)
@@ -18,35 +18,8 @@
"""
__docformat__ = 'restructuredtext'
-from zope.configuration.fields import GlobalObject
-from zope.browserpage.metaconfigure import registerType
-from zope.interface import Interface
-from zope.schema import TextLine
-
# BBB
from zope.browserpage.metaconfigure import clear
+from zope.browserpage.metadirectives import IExpressionTypeDirective
+from zope.browserpage.metaconfigure import expressiontype
-
-class IExpressionTypeDirective(Interface):
- """Register a new TALES expression type"""
-
- name = TextLine(
- title=u"Name",
- description=u"""Name of the expression. This will also be used
- as the prefix in actual TALES expressions.""",
- required=True
- )
-
- handler = GlobalObject(
- title=u"Handler",
- description=u"""Handler is class that implements
- zope.tales.interfaces.ITALESExpression.""",
- required=True
- )
-
-def expressiontype(_context, name, handler):
- _context.action(
- discriminator = ("tales:expressiontype", name),
- callable = registerType,
- args = (name, handler)
- )
Deleted: zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/tests/test_directives.py
===================================================================
--- zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/tests/test_directives.py 2010-04-26 15:59:30 UTC (rev 111431)
+++ zope.app.pagetemplate/trunk/src/zope/app/pagetemplate/tests/test_directives.py 2010-04-26 15:59:42 UTC (rev 111432)
@@ -1,60 +0,0 @@
-##############################################################################
-#
-# 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.
-#
-##############################################################################
-"""Tests to check talesapi zcml configuration
-
-$Id$
-"""
-import unittest
-
-from zope.component.testing import PlacelessSetup
-
-template = """<configure
- xmlns='http://namespaces.zope.org/zope'
- xmlns:tales='http://namespaces.zope.org/tales'>
- %s
- </configure>"""
-
-
-class Handler(object):
- pass
-
-class Test(PlacelessSetup, unittest.TestCase):
-
- def setUp(self):
- from zope.configuration.xmlconfig import XMLConfig
- import zope.app.pagetemplate
- super(Test, self).setUp()
- XMLConfig('meta.zcml', zope.app.pagetemplate)()
-
- def testExpressionType(self):
- from cStringIO import StringIO
- from zope.configuration.xmlconfig import xmlconfig
- from zope.pagetemplate.engine import Engine
- xmlconfig(StringIO(template % (
- """
- <tales:expressiontype
- name="test"
- handler="zope.app.pagetemplate.tests.test_directives.Handler"
- />
- """
- )))
- self.assert_("test" in Engine.getTypes())
- self.assert_(Handler is Engine.getTypes()['test'])
-
-def test_suite():
- loader=unittest.TestLoader()
- return loader.loadTestsFromTestCase(Test)
-
-if __name__=='__main__':
- unittest.TextTestRunner().run(test_suite())
More information about the checkins
mailing list