Ignore:
Timestamp:
Jul 7, 2008, 4:29:02 PM (13 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@55
Message:

Refactor Data Forms.

Author: ralphm.
Fixes #13.

This refactoring provides an abstract representation of Forms, Fields and
Options and each of those can be parsed from or unparsed to XML. This change
also simplifies testing in test_pubsub, by allowing the 'received' requests
to be represented as an XML snippit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/iwokkel.py

    r24 r25  
    390390        """
    391391
     392    def getConfigurationOptions():
     393        """
     394        Retrieve all known node configuration options.
     395
     396        The returned dictionary holds the possible node configuration options
     397        by option name. The value of each entry represents the specifics for
     398        that option in a dictionary:
     399
     400        - C{'type'} (C{str}): The option's type (see
     401          L{Field<wokkel.data_form.Field>}'s doc string for possible values).
     402        - C{'label'} (C{unicode}): A human readable label for this option.
     403        - C{'options'} (C{dict}): Optional list of possible values for this
     404          option.
     405
     406        Example::
     407
     408            {
     409            "pubsub#persist_items":
     410                {"type": "boolean",
     411                 "label": "Persist items to storage"},
     412            "pubsub#deliver_payloads":
     413                {"type": "boolean",
     414                 "label": "Deliver payloads with event notifications"},
     415            "pubsub#send_last_published_item":
     416                {"type": "list-single",
     417                 "label": "When to send the last published item",
     418                 "options": {
     419                     "never": "Never",
     420                     "on_sub": "When a new subscription is processed"}
     421                }
     422            }
     423
     424        @rtype: C{dict}.
     425        """
     426
    392427    def getDefaultConfiguration(requestor, service):
    393428        """
Note: See TracChangeset for help on using the changeset viewer.