On 4/10/13, Olemis Lang <[email protected]> wrote:
> On 4/10/13, Andrej Golcov <[email protected]> wrote:
>
[...]
>>> If you ask me I prefer (3) or (2) .
>> AFIK, "context" parameter is used in multiple places in Trac with
>> meaning of context e.g. in resource ResourceContext, in versioncontrol
>> in wiki formatters.
>
> That's the point . All those cases make reference to the rendering context
> .
>
Just take the time to make a quick research to realize that even if
IResourceManager.get_resource_description states that :type context:
`ResourceContext` , in real life life there's no such ResourceContext
class . That method accepts a rendering context i.e.
{{{
#!py
def get_resource_description(resource, format='default', context=None,
**kwargs):
"""Return a string representation of the resource, according to the
`format`.
:param resource: the `Resource` to describe
:param format: the kind of description wanted. Typical formats are:
`'default'`, `'compact'` or `'summary'`.
:param context: an optional rendering context to allow rendering rich
output (like markup containing links)
:type context: `ResourceContext`
[...]
"""
}}}
{{{
#!sh
$ grep -r ResourceContext trac
trac/resource.py: :type context: `ResourceContext`
}}}
that makes my point more clear . Variable name `context` is even used
in the same file for to completely unrelated purposes . That's
confusing .
[...]
--
Regards,
Olemis.