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

Stephan Richter srichter@cbu.edu
Fri, 25 Jan 2002 09:11:11 -0500


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

Added Files:
      Tag: Zope-3x-branch
	IWidget.py IWidget.pyc Widget.py Widget.pyc __init__.py 
	__init__.pyc 
Log Message:
- Initial check-in of the Formulator code
- Even though not everything works (specifically the widgets are in bad 
  shape), I am checking that stuff in, so that Jim, Martijn F. and I can
  better work together.
- The FileEdit screen (which will be checked in in a minute) uses already
  formulator.
- The validators are closed to finished.
- I think we have to rethink some of the design, simply because it is too
  hard right now to create a field and a view for a property, even though
  I provided already some handy methods. However Formulator does not 
  depend on Property-driven content objects.
- Please contact me (srichter@cbu.edu) or the Zope3 mailining list to 
  discuss issues and design.


=== Added File Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.py ===
##############################################################################
#
# 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
# 
##############################################################################
"""

Revision information: $Id: IWidget.py,v 1.1.2.1 2002/01/25 14:11:09 srichter Exp $
"""

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."""


=== Added File Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.pyc ===
-
`Q<c       s9     d  Z    d k l Z  d e f d     YZ d S(   s   

Revision information: $Id: IWidget.pyc,v 1.1.2.1 2002/01/25 14:11:09 srichter Exp $
(   s	   Interfaces   IWidgetc      s&    d  Z    d   Z # d   Z RS(   s  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.
    c    s
      d S(   s)   Look up a Widget setting (value) by name.N(    (   s   name(    (    s<   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.pys   getValue s   c      s
   # $ d S(   s0   Get the context of the widget, namely the Field.N(    (    (    (    s<   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.pys
   getContext# s   (   s   __doc__s   getValues
   getContext(    (    (    s<   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.pys   IWidget s   	N(   s   __doc__s	   Interfaces   IWidget(   s	   Interfaces   IWidget(    (    s<   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/IWidget.pys   ? s   

=== Added File Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.py ===
##############################################################################
#
# 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
# 
##############################################################################
"""

Revision information: $Id: Widget.py,v 1.1.2.1 2002/01/25 14:11:09 srichter Exp $
"""
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


=== Added File Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.pyc ===
-
-`Q<c       s6     d  Z    d k l Z  d f  d     YZ d S(   s   

Revision information: $Id: Widget.pyc,v 1.1.2.1 2002/01/25 14:11:09 srichter Exp $
(   s   IWidgets   Widgetc      sD    d  Z    e Z  g  Z  d   Z # d   Z ) d   Z RS(   sR   I do not know what will be in this class, but it provides
    an extra layer.
    c    s       | |  _ d S(   s    N(   s   fields   selfs   _field(   s   selfs   field(    (    s;   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.pys   __init__ s   c    s4   # $ % | |  i j o & t |  | t  Sn d S(   s    N(   s   names   selfs
   propertyNamess   getattrs   None(   s   selfs   name(    (    s;   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.pys   getValue# s   c    s   ) * + |  i Sd S(   s    N(   s   selfs   _field(   s   self(    (    s;   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.pys
   getContext) s   (   s   __doc__s   IWidgets   __implements__s
   propertyNamess   __init__s   getValues
   getContext(    (    (    s;   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.pys   Widget s   			N(   s   __doc__s   IWidgets   Widget(   s   Widgets   IWidget(    (    s;   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/Widget.pys   ? s   

=== Added File Zope3/lib/python/Zope/App/Formulator/Widgets/__init__.py ===
##############################################################################
#
# 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
# 
##############################################################################
"""

Revision information: $Id: __init__.py,v 1.1.2.1 2002/01/25 14:11:09 srichter Exp $
"""


=== Added File Zope3/lib/python/Zope/App/Formulator/Widgets/__init__.pyc ===
-
X_Q<c       s     d  Z   d S(   s   

Revision information: $Id: __init__.pyc,v 1.1.2.1 2002/01/25 14:11:09 srichter Exp $
N(   s   __doc__(    (    (    s=   /opt/Zope3/lib/python/Zope/App/Formulator/Widgets/__init__.pys   ? s