vendor/Five/1.2b-r20590

view tests/metaconfigure.py @ 0:3673ed425f80

Vendor import of Five 1.2b+ (r20590)
author fguillaume
date Fri, 02 Dec 2005 20:25:42 +0000
parents
children
line source
1 ##############################################################################
2 #
3 # Copyright (c) 2004, 2005 Zope Corporation and Contributors.
4 # All Rights Reserved.
5 #
6 # This software is subject to the provisions of the Zope Public License,
7 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11 # FOR A PARTICULAR PURPOSE.
12 #
13 ##############################################################################
14 """Parrot directive and support classes
16 $Id: metaconfigure.py 12884 2005-05-30 13:10:41Z philikon $
17 """
18 from zope.interface import Interface
19 from zope.configuration.fields import GlobalObject
20 from zope.schema import TextLine
22 class IParrotDirective(Interface):
23 """State that a class implements something.
24 """
25 class_ = GlobalObject(
26 title=u"Class",
27 required=True
28 )
30 name = TextLine(
31 title=u"Name",
32 description=u"The parrots name.",
33 required=True
34 )
36 def parrot(_context, class_, name):
37 parrot = class_()
38 parrot.pineForFjords()
41 class NorwegianBlue(object):
43 def pineForFjords(self):
44 return "This parrot is no more!"