from trac.mimeview.api import Context doesn't work, cannot find Context

30 views
Skip to first unread message

Ozgur Polat

unread,
May 22, 2020, 7:07:03 PM5/22/20
to Trac Development
Hi,

I am working on a trac plug-in that I developed a few years ago, I am modifying it on it to put it on my Github account. When I tried the plug-in with the the latest Trac, I get an error. It cannot find the Context. So I went inside 

trac.mimeview.api to search for Context, and I realized that it has been removed and maybe replaced with RenderingContext. Just to see if it would work I tried to replace Context with rendering context but that did not work. I was wondering if anyone had a similar problem and if you know how to fix this?

context = Context.from_request(self.req, 'wiki')

context = RenderingContext.from_request(self.req, 'wiki')

Many thanks.

RjOllos

unread,
May 22, 2020, 8:54:18 PM5/22/20
to Trac Development
You'll want to use:

from trac.web.chrome import web_context

context = web_context(self.req, 'wiki')


 

Ozgur Polat

unread,
May 23, 2020, 9:39:54 AM5/23/20
to trac...@googlegroups.com
Hi  RjOllos

This worked, thank you.

--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-dev/f7d38746-9899-4036-b551-df9f176fb9af%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages