> Would it not make more sense if this code were simply committed into an
> appropriate place in trunk? Or even better, quoted inline in this
> message, so that it gets archived along with the rest of the mailing
> list? AFAIU pastbin links are not eternal, which could make
> reconstructing this discussion from archives a bit of a chore.
I haven't sent the code in mail since python markup can be messed by
email but you are right,  pastebin is an external dependency.

Here is the code previously from the link above:
------------------------
class IResourceChangingListener(Interface):
    """Extension point interface for components that require notification
    when a resource is in process of creation, modification, or deletion.

    Events are called when action is in progress and allow listener to perform
    database manipulation within the same transaction as parent action.
    Because of the involved transaction, listener activity should be short
    running.

    'db' is instance of TransactionContextManager used by a parent
    activity
    'resource' parameters is instance of the a resource e.g. ticket, milestone
    etc.
    'context' is an action context, may contain author, comment etc. Context
    content depends on a resource type.
    """

    def get_subscribed_resources():
        """
        Implementation should return iterator of resource types for which
        a listener has to be notified.

        None or empty list means all types of resources.
        """

    def match_resource(resource):
        """Return whether the listener wants to process the given resource."""

    def resource_creating(db, resource, context):
        """
        Called when a resource is in creating phase.
        """

    def resource_changing(db, resource, old_values, context):
        """Called when a resource is in changing phase.

        `old_values` is a dictionary containing the previous values of the
        resource properties that changed. Properties are specific for resource
        type.
        """

    def resource_deleting(db, resource, context):
        """Called when a resource is in deleting phase."""

    def resource_version_deleting(db, resource, context):
        """Called when a version of a resource in deleting phase."""

Reply via email to