Esempio n. 1
0
class IEcho(Interface):

    message = schema.Text(title=u"Message", required=False)

    echo_on_add = fields.Bool(title=u"Echo when parsing ZCML.",
                              required=False,
                              default=False)
Esempio n. 2
0
class IFieldInfo(interface.Interface):

    name = schema.BytesLine(title=u"The field name")

    title = schema.TextLine(
        title=u"Title",
        description=u"A short summary or label",
        default=u"",
        required=False,
    )

    required = fields.Bool(
        title=u"Required",
        description=u"Determines whether a value is required.",
        default=True)

    readonly = fields.Bool(title=u"Read Only",
                           description=u"Can the value be modified?",
                           required=False,
                           default=False)
Esempio n. 3
0
class IBehaviorDirective(Interface):
    """Directive which registers a new behavior type.

    The registration consists of:

        * a global named utility registered by interface identifier
        * a global named utility registered by lookup name
        * an associated global and unnamed behavior adapter
    """

    name = TextLine(title=u'Name',
                    description=u'Convenience lookup name for this behavior',
                    required=False)

    title = configuration_fields.MessageID(
        title=u'Title',
        description=u'A user friendly title for this behavior',
        required=True)

    description = configuration_fields.MessageID(
        title=u'Description',
        description=u'A longer description for this behavior',
        required=False)

    provides = configuration_fields.GlobalInterface(
        title=u'An interface to which the behavior can be adapted',
        description=u'This is what the conditional adapter factory will '
        u'be registered as providing',
        required=True)

    marker = configuration_fields.GlobalInterface(
        title=u'A marker interface to be applied by the behavior',
        description=u'If factory is not given, then this is optional',
        required=False)

    factory = configuration_fields.GlobalObject(
        title=u'The factory for this behavior',
        description=u'If this is not given, the behavior is assumed to '
        u'provide a marker interface',
        required=False)

    for_ = configuration_fields.GlobalObject(
        title=u'The type of object to register the conditional adapter '
        u'factory for',
        description=u'This is optional - the default is to register the '
        u'factory for zope.interface.Interface',
        required=False)

    name_only = configuration_fields.Bool(
        title=u'Do not register the behavior under the dotted path, but '
        u'only under the given name',
        description=u'Use this option to register a behavior for the same '
        u'provides under a different name.',
        required=False)
Esempio n. 4
0
class ISettingDirective(Interface):

    key = fields.PythonIdentifier(title=u"Key")

    text = fields.MessageID(title=u"Text that describes the setting")

    alt_text = fields.MessageID(title=u"Text that describes 'setting=False'",
                                required=False)

    default = fields.Bool(title=u"Default setting",
                          required=True,
                          default=False)
Esempio n. 5
0
class IPreferenceGroupDirective(Interface):
    """Register a preference group."""

    # The id is not required, since the root group has an empty id.
    id = OptionalDottedName(
        title=u"Id",
        description=u"""
            Id of the preference group used to access the group. The id should
            be a valid path in the preferences tree.""",
        required=False,
        )

    schema = fields.GlobalInterface(
        title=u"Schema",
        description=u"Schema of the preference group used defining the "
                    u"preferences of the group.",
        required=False
        )

    title = fields.MessageID(
        title=u"Title",
        description=u"Title of the preference group used in UIs.",
        required=True
        )

    description = fields.MessageID(
        title=u"Description",
        description=u"Description of the preference group used in UIs.",
        required=False
        )

    category = fields.Bool(
        title=u"Is Group a Category",
        description=u"Denotes whether this preferences group is a category.",
        required=False,
        default=False
        )
Esempio n. 6
0
class IMessageQueueConfigSchema(interface.Interface):
    message_exchange=schema.Text(
        title=u"Message Exchange",
        description=u"Fanout Exchange name to be used",
        required=True,
        )
    task_exchange=schema.Text(
        title=u"Task Queue Exchange",
        description=u"Direct task queue exchange name to be used",
        required=True,
        )
    username=schema.Text(
        title=u"Username",
        description=u"Username to be used to connect to the AMQP server",
        required=True,
        default=u"guest"
        )
    password=schema.Text(
        title=u"Password",
        description=u"Password to be used to connect to the AMQP server",
        required=True,
        default=u"guest"
        )
    host=schema.Text(
        title=u"Host",
        description=u"AMQP Server Host",
        required=True,
        default=u"localhost"
        )
    port=schema.Int(
        title=u"Port",
        description=u"AMQP Server Port Number",
        required=True,
        default=5672
        )
    virtual_host=schema.Text(
        title=u"Virtual Host",
        description=u"Virtual host to use",
        required=True,
        default=u"/"
        )
    channel_max=schema.Int(
        title=u"Channel Max",
        description=u"Maximum number of channels to allow",
        required=True,
        default=0
        )
    frame_max=schema.Int(
        title=u"Max frame size",
        description=u"The maximum byte size for an AMQP Frame",
        required=True,
        default=131072
        )
    heartbeat=fields.Bool(
        title=u"Heartbeat",
        description=u"Turn heartbeat checking on or off",
        required=True,
        default=False
        )
    number_of_workers=schema.Int(
        title=u"Number of worker processes",
        description=u"Number of worker daemon processes",
        required=True,
        default=5
        )
    task_queue=schema.Text(
        title=u"Task queue name",
        description=u"Task queue name",
        required=True,
        default=u"task_queue"
        )