As a side note (I'm not sure it really fits in this thread...), I
think it would be nice to provide unique "action handlers" for ticket
as an external API.

Let me explain: today, the contrib/trac-post-commit-hook automatically
closes a ticket with the following piece of code:

try:
    ticket = Ticket(self.env, tkt_id)
    ticket['status'] = 'closed'
    ticket['resolution'] = 'fixed'
    ticket.save_changes(self.author, self.msg, self.now)
    tn = TicketNotifyEmail(self.env)
    tn.notify(ticket, newticket=0, modtime=self.now)
except Exception, e:
    print>>sys.stderr, 'Unexpected error while processing ticket ' \
                               'ID %s: %s' % (tkt_id, e)

This would be nice if this sequence was simpler, so that when the hook
wants to close a ticket, it simply calls something like

try:
    ticket = Ticket(self.env, tkt_id)
    ticket.close(resolution = 'fixed')
except Exception, e:
    print>>sys.stderr, 'Unexpected error while processing ticket ' \
                               'ID %s: %s' % (tkt_id, e)

so that when the internal implementation of the ticket or the
notification changes, external components such as the hook scripts
remain unchanged.

Cheers,
Manu

On 3/15/06, Christian Boos <[EMAIL PROTECTED]> wrote:
> Alec Thomas wrote:
> > ...
> > All of this is in the top part of the WorkFlow page [1]. Please take a
> > look and reply with any comments/criticisms. In particular use cases
> > that could not be handled by the proposed system would be good.
> >
>
> I know that there is explicit support for ''hidden'' fields,
> but would it be possible to easily implement
> http://projects.edgewall.com/trac/ticket/1580
> ?
>
> -- Christian
> _______________________________________________
> Trac-dev mailing list
> [email protected]
> http://lists.edgewall.com/mailman/listinfo/trac-dev
>


--
Manu
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev

Reply via email to