[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Formulator/Widgets - IWidget.py:1.1.2.4 Widget.py:1.1.2.4

Stephan Richter srichter@cbu.edu
Tue, 5 Mar 2002 19:01:09 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Formulator/Widgets
In directory cvs.zope.org:/tmp/cvs-serv10102/Widgets

Added Files:
      Tag: Zope-3x-branch
	IWidget.py Widget.py 
Log Message:
undo deleteion while trying to create a new branch. That should fix recent 
errors. 


=== Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.py 1.1.2.3 => 1.1.2.4 ===
+#
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (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$
+"""
+
+from Interface import Interface
+
+
+class IWidget(Interface):
+    """Generically describes the behavior of a widget.
+
+    The widget defines a list of propertyNames, which describes
+    what properties of the widget are available to use for
+    constructing the widget render output.
+
+    Note that this level must be still presentation independent.
+    """
+
+    def getValue(name):
+        """Look up a Widget setting (value) by name."""
+
+
+    def getContext():
+        """Get the context of the widget, namely the Field."""


=== Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.py 1.1.2.3 => 1.1.2.4 ===
+#
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (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$
+"""
+from IWidget import IWidget
+
+
+class Widget:
+    """I do not know what will be in this class, but it provides
+    an extra layer.
+    """
+
+    __implements__ = IWidget
+
+    propertyNames = []
+
+
+    def __init__(self, field):
+        """ """
+        self._field = field
+
+
+    def getValue(self, name):
+        """ """
+        if name in self.propertyNames:
+            return getattr(self, name, None)
+
+
+    def getContext(self):
+        """ """
+        return self._field