Beispiel #1
0
class IPlumbusMaker(interface.Interface):

    grumbo = interface.Attribute("The dinglebop is fed through here")
    fleeb = interface.Attribute("The dinglebop is polished with this")

    def smoothTheDinglebop(schleem):
        """
Beispiel #2
0
class IPlugin(interface.Interface):
    """
    A basic interface for allkind of plugins
    """

    dispatcher = interface.Attribute("An IEventDispatcher object to let other plugins connect to the plugin trough events")
    application = interface.Attribute("Automatically set when initializing the plugin")
    context = interface.Attribute("Automatically set when loading the plugin into the current context")
    plugin = interface.Attribute("Automatically set when creating a new instance of the plugin to be plugged into another one")

    def preload(context):
        """
        Called before loading the plugin
        """

    def load(context):
        """
        Load plugin in the current context
        """       

    def plug(plugin):
        """
        Plug the plugin into another plugin
        """

    def unload(context):
        """
        Unload plugin from the current context
        """

    def unplug(plugin):
        """
Beispiel #3
0
class IButton(interface.Interface):
    """A button in a form."""

    accessKey = interface.Attribute('Access Key')
    actype = interface.Attribute('Action type (i.e. primary, danger, etc)')
    condition = interface.Attribute(
        'Callable, first argument is form instance')
Beispiel #4
0
class ISubscription(interface.Interface):
    """
    Data for a subscription
    """

    notif_type = interface.Attribute(
        "Type of notification. One of "
        "`('instant', 'daily', 'weekly', 'monthly')`")

    lang = interface.Attribute("Preferrd language of notification messages")

    def check_permission(obj):
        """
        Check if the subscriber should receive notifications for
        changes on `obj`. Returns `True` or `False`.
        """

    def get_email(obj):
        """
        Return the subscriber's e-mail address. If not found,
        return None, and the notification message will be skipped.

        The `obj` parameter exists because subscriptions have no
        awearness of their context; some of them (e.g. the Naaya
        `AccountSubscription`) need to access the site in order to
        find the email address. `obj` is the subject of the current
        notification (the object that has been created/changed).
        """

    def to_string(obj):
        """
Beispiel #5
0
class IPythonPackage(interface.Interface):
    """
    Implementers of this interface are representations
    of a LaTeX package (e.g., as used with \\usepackage)
    written in Python. This is typically a python module,
    though that is not required. All func:`vars` of the object
    that represent macros (having a ``macroName``) are
    loaded into the document context.

    During lookup for a package, an adapter from
    :class:`IDocumentContext` having the given name will first be
    looked for, followed by a utility with the given name; other
    search methods are considered secondary to the component lookup.
    """

    template_directory = interface.Attribute(
        """Optional attribute giving a path to a directory
    containing template files that can be used in the rendering
    of the macros implemented by this package.
    """)

    texinputs_directory = interface.Attribute(
        """Optional attribute giving a path to a directory
    containing style files (.sty) needed to make pure LaTeX
    commands happy about this package.
    """)
Beispiel #6
0
class ITerminalApplication(IApplication):

    dialog = interface.Attribute(
        "If set, a modal dialog object that can display itself to the terminal and handle input."
    )
    term_size = interface.Attribute("The width and height of the terminal.")
    terminal = interface.Attribute(
        "The application interacts with the client terminal via this object.")

    def handle_input(key_id, modifiers):
        """
        Handles terminal input.
        """

    def install_dialog(dialog):
        """
        Installs a modal terminal dialog.
        """

    def terminalSize(w, h):
        """
        Called when the terminal is resized.
        """

    def update_display():
        """
class IAcknowledgements(interface.Interface):
    """ acknowledgements configlet """

    records = interface.Attribute('Records')
    catalog = interface.Attribute('Catalog')

    def add(object, record):
        """ add activity record """

    def remove(rid):
        """ remove activity record """

    def removeObject(object):
        """ remove records for object """

    def objectRecords(object):
        """ return object records """

    def updateObjectRecords(object):
        """ reindex records for object """

    def search(**kw):
        """ search records """

    def getObject(id):
        """ return record by id """
Beispiel #8
0
class INode(interface.Interface):
    """ base """

    __id__ = interface.Attribute('Id')
    __uri__ = interface.Attribute('Uri')
    __type_id__ = interface.Attribute('Node type')
    __parent_uri__ = interface.Attribute('Node parent')
Beispiel #9
0
class IHost(interface.Interface):
  
  hostname = interface.Attribute("hostname")
  family = interface.Attribute("family")
  address = interface.Attribute("address")
  data_size = interface.Attribute("data_size")
  qos = interface.Attribute("qos")
Beispiel #10
0
class ISkinTemplate(interface.Interface):
    """Skin templates are page templates which reside in a skin
    directory. These are registered as named components adapting on
    (context, request)."""

    name = interface.Attribute(
        """This is the basename of the template filename relative to
        the skin directory. Note that the OS-level path separator
        character is replaced with a forward slash ('/').""")

    path = interface.Attribute(
        """Full path to the template. This attribute is available to
    allow applications to get a reference to files that relate to the
    template file, e.g. metadata or additional resources. An example
    could be a title and a description, or a icon that gives a visual
    representation for the template.""")

    def __call__(context, request):
        """Returns a bound skin template instance."""

    def get_api(name):
        """Look up skin api by name."""

    def get_macro(name):
        """Look up skin macro by name."""
Beispiel #11
0
class ISlide(interface.Interface):
    """
    A slide page.
    """

    carousel_id = interface.Attribute("The string id")
    slides_content = interface.Attribute("A list of strings of image paths")
Beispiel #12
0
class IActionExecutedEvent(interface.Interface):
    """
    An event emitted when an action has been performed.
    """
    name = interface.Attribute("Name of the action performed, if any")

    action = interface.Attribute("The performed action")
Beispiel #13
0
class IAction(interface.Interface):
    """An OpenFlow action."""

    type = interface.Attribute(
        """The type of the action, as one of OFPAT_* constants.
        """)

    format_length = interface.Attribute(
        """The length of the data in the encoded action.

        This length doesn't count the ofp_action_header information.
        """)

    def serialize():
        """Serialize this action object into an OpenFlow action.

        The returned string can be passed to deserialize() to recreate
        a copy of this action object.

        Returns:
            A binary string that is a serialized form of this action
            object into an OpenFlow action. The ofp_action_header
            structure is not included in the generated strings.
        """

    def deserialize(buf):
        """Returns an action object deserialized from a sequence of bytes.
Beispiel #14
0
class ISignatoriesValidator(interface.Interface):
    """Validation machinery for iterms with signatories"""

    signatories = interface.Attribute("""signatories iteratable""")

    min_signatories = interface.Attribute("""minimum consented signatories""")

    max_signatories = interface.Attribute("""maximum consented signatories""")

    signatories_count = interface.Attribute("""number of signatories""")

    consented_signatories = interface.Attribute("""number of consented """)

    def validateSignatories():
        """Validate signatories count on parliamentary item i.e. number added
        """

    def validateConsentedSignatories():
        """Validate number of consented signatories against min and max
        """

    def allowSignature():
        """Check that the current user has the right to consent on document 
        """

    def documentSubmitted():
        """Check that the document has been submitted
        """

    def documentInDraft():
        """Check that the document is in draft stage
        """

    def expireSignatures():
        """Should pending signatures be archived
Beispiel #15
0
class IElementChangeEvent(IElementEvent):
    """
    Generic event fired when element state changes.
    """
    property = interface.Attribute("The property that changed")
    old_value = interface.Attribute("The property value before the change")
    new_value = interface.Attribute("The property value after the change")
Beispiel #16
0
class IConnectionToRegion(IConnection):

    localIdent = interface.Attribute(
        "ident", "An identifier for this end of the connection.")

    address = interface.Attribute(
        "address", "The address of the far end of the connection.")
Beispiel #17
0
class IParticipant(interface.Interface):
    """Workflow participant
    """

    __name__ = interface.Attribute("Name")

    description = interface.Attribute("Description")
Beispiel #18
0
class IPropertyChangeEvent(interface.Interface):
    
    """A property changed event has a name, an old value, and a new value."""

    name = interface.Attribute("The property name")
    old_value = interface.Attribute("The property value before the change")
    new_value = interface.Attribute("The property value after the change")
Beispiel #19
0
class IAvatar(interface.Interface):

    user_id = interface.Attribute("The user ID")
    reactor = interface.Attribute("The twisted reactor")
    application = interface.Attribute(
        "The application currently associated with this avatar.")

    def install_application(app_protocol):
        """
        Link an application to this avatar and the user entry.
        """

    def init_app_protocol():
        """
        Initialize the default application protocol.
        """

    def send_app_signal(signal):
        """
        Send a signal to the linked application.
        """

    def send_message(msg):
        """
        Display a message via the client connecting to this avatar.
        """

    def shut_down():
        """
Beispiel #20
0
class IDiagramTabChange(interface.Interface):
    """
    The selected diagram changes.
    """
    item = interface.Attribute('The newly selected DockItem')

    diagram_tab = interface.Attribute('The newly selected diagram tab')
Beispiel #21
0
class IGrokView(IBrowserPage):
    """Grok views all provide this interface."""

    context = interface.Attribute('context', "Object that the view presents.")

    request = interface.Attribute('request', "Request that the view was looked"
                                  "up with.")

    response = interface.Attribute('response', "Response object that is "
                                   "associated with the current request.")

    static = interface.Attribute('static', "Directory resource containing "
                                 "the static files of the view's package.")

    def redirect(url):
       """Redirect to given URL"""

    def url(obj=None, name=None):
        """Construct URL.

        If no arguments given, construct URL to view itself.

        If only obj argument is given, construct URL to obj.

        If only name is given as the first argument, construct URL
        to context/name.

        If both object and name arguments are supplied, construct
        URL to obj/name.
        """

    def update(**kw):
        """This method is meant to be implemented by grok.View
        subclasses.  It will be called *before* the view's associated
        template is rendered and can be used to pre-compute values
        for the template.

        update() can take arbitrary keyword parameters which will be
        filled in from the request (in that case they *must* be
        present in the request)."""

    def render(**kw):
        """A view can either be rendered by an associated template, or
        it can implement this method to render itself from Python.
        This is useful if the view's output isn't XML/HTML but
        something computed in Python (plain text, PDF, etc.)

        render() can take arbitrary keyword parameters which will be
        filled in from the request (in that case they *must* be
        present in the request)."""

    def application_url(name=None):
        """Return the URL of the closest application object in the
        hierarchy or the URL of a named object (``name`` parameter)
        relative to the closest application object.
        """

    def flash(message, type='message'):
        """Send a short message to the user."""
Beispiel #22
0
class IActionProvider(interface.Interface):
    """
    An action provider is a special service that provides actions
    (see gaphor/action.py) and the accompanying XML for the UI manager.
    """
    menu_xml = interface.Attribute("The menu XML")

    action_group = interface.Attribute("The accompanying ActionGroup")
Beispiel #23
0
class ICell(zi.Interface):
    """The Basic Cell Interface, implemented by all Nodes and Cells"""

    parent = zi.Attribute("Node: The parent object of the cell")
    dateCreated = zi.Attribute("String: The date the cell was created")
    dateModified = zi.Attribute(
        "String: The date the cell was most recently modified")
    tags = zi.Attribute("List of Strings: Tags used for searching")
Beispiel #24
0
class IUnicodeMellonFile(IMellonFile):
    """A Unicode (text) file to be processed by the application"""
    snippet_lines_increment = \
        interface.Attribute("Number of lines to jump after each snippet, 0 "+
                            "indicates entire data.")
    snippet_lines_coverage = \
        interface.Attribute("Number of lines to include in each snippet "+
                            "if available, 0 indicates all remaining lines.")
class ICollectionSchemaField(ISchemaField):
    """This is a field for zope schema collection field. It is defined
    in order to be able to have a generic behavior on collections.
    """
    collectionType = interface.Attribute(
        u"Python type represented by this collection (like set, list...)")
    valueField = interface.Attribute(
        u"Field corresponding to the value type contained in the collection")
Beispiel #26
0
class IDiagramPageChange(interface.Interface):
    """
    The selected diagram changes.
    """

    item = interface.Attribute("The newly selected Notebook pane")

    diagram_page = interface.Attribute("The newly selected diagram page")
Beispiel #27
0
class IPrincipal(interface.Interface):
    """ principal """

    __uri__ = interface.Attribute('Unique principal id')

    name = interface.Attribute('Human readable principal name')

    login = interface.Attribute('Principal login')
class ICatalystContext(interface.Interface):

    domain_model = interface.Attribute("domain_model")

    domain_interface = interface.Attribute('domain_interface')

    echo = schema.Bool(
        title=u"Whether or not generated actions should be printed")
Beispiel #29
0
class IApplicationDefinition(interface.Interface):
    """Application definition
    """

    __name__ = interface.Attribute("Name")

    description = interface.Attribute("Description")

    parameters = interface.Attribute("A sequence of parameter definitions")
Beispiel #30
0
class IParameterDefinition(interface.Interface):
    """Parameter definition
    """

    name = interface.Attribute("Parameter name")

    input = interface.Attribute("Is this an input parameter?")

    output = interface.Attribute("Is this an output parameter?")