On Nov 15, 3:04 am, Steffen Hoffmann <[email protected]> wrote: > If I browse the repository and request the current resource (inside a > Trac plugin) like > resource = data['context'].resource > > I get resource realm 'source'. But `IRequestHandler` only exists for > 'export'|'browser'|'file' (see ./trac/versioncontrol/web_ui/browser), > not 'source'. Assembling an URL with the Href object like > link = href.source(... > > doesn't translate to 'browser' realm either. > > What do I miss? Thanks in advance for any hint.
Resources and urls are not linked, and the fact that a wiki resource is available at /wiki urls and similar is just because the share the same name. Other resource providers may for instance provide various resources under the same parent URL. So, don't confuse resources with anything related to request handling. Anyway, what you want is to check trac.resource and in particular the utility method get_resource_url(env, resource, href, **kwargs) available from there. All resource providers must support the get_resource_url() so that given a resource and a href, the resource URL can be constructed. :::simon -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
