On 12/17/12, Ethan Jucovy <ethan.juc...@gmail.com> wrote:
> On Mon, Dec 17, 2012 at 6:25 AM, Andrej Golcov <and...@digiverse.si> wrote:
>
>> I'm implementing code listening on ITicketChangeListener interface calls.
>> I would like to call add_warning in addition to logging just in case if
>> something go wrong inside the method. The add_warning method requires
>> request object that is not provided by ITicketChangeListener.
>>
>
> I recently figured out a way to get a request object in
> ITicketChangeListener methods, by looking at each frame of the call stack
> until I find one, and exiting out of my code if I never find one:
>
>
> https://github.com/boldprogressives/trac-WorkflowNotificationPlugin/blob/master/workflow_notification/__init__.py#L137
>
> But, as Chris says, you probably shouldn't do this, unless you have no
> other options.  If you can figure out some way to hang your code off an
> IRequestFilter instead, it'd probably be safer.
>

What about using ITicketManipulator ?
;)

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-dev@googlegroups.com.
To unsubscribe from this group, send email to 
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to