Menu

Trac Commit Log


Commit Date  
[r4560] by cboos

Blame branch: merged [4540:4559/trunk], plus added a workaround for extraline generated by the highlighter (probably due to r4548)

2007-01-13 14:23:51 Tree
[r4559] by cboos

Use Pygments' `__version__` information, if loaded from source and no pkginfo data can be found.

2007-01-13 13:45:59 Tree
[r4558] by cboos

PermissionPolicy: follow-up to r4557, as `self._context_map != self._resource_map`

2007-01-13 11:27:34 Tree
[r4557] by athomas

PermissionPolicy: Some minor refactoring plus fixed a privilege leak in the `PermissionCache`.

2007-01-13 00:30:15 Tree
[r4556] by cboos

PermissionPolicy: reworked a bit the !ResourceSystem

{{{
#!python
class IResourceMapper(Interface):
"""Map between Trac resources and their corresponding contexts."""

def get_resource_factories():
"""Generator yielding `(realm, resource_factory)` pairs.

The `resource_factory` is a function taking a `Context` and
returning an instance of a Resource subclass.
"""

def get_context_classes():
"""Generator yielding `(realm, context_subclass)` pairs."""
}}}

Example implementation:
{{{
#!python
# IResourceMapper methods

def get_resource_factories(self):
def wiki_page_factory(context):
from trac.wiki.model import WikiPage
assert context.resource == 'wiki'
return WikiPage(self.env, context.id)
# TODO: add `context.version` after blame integration
yield ('wiki', wiki_page_factory)

def get_context_classes(self):
return [] # base Context is OK so far, but could be:
# yield ('wiki', WikiContext)
}}}

More Context related changes:
- finish the s/resource/realm/ renaming started in r4552
- rename s/object/resource/
- `from_resource(req, resource)` doesn't need an env parameter,
as this is assumed to be available from the `resource`
- I think the above method is enough for getting a Context from a resource,
so I've reverted r4551
- fixed the `__call__` method and make it clearer
- documentation updates

In the !PermissionCache, effectively cache the results of the permission check. Ideally, those results should be cached at the Request level, I think.

2007-01-12 19:02:32 Tree
[r4555] by cboos

PermissionPolicy: some PEP:0008 fixes for perm.py and fix unit tests for the new permission cache, as it stands now.

2007-01-12 16:36:45 Tree
[r4554] by cboos

Blame branch: simplified the <meta name=ROBOTS> tags following mgood's suggestion.

2007-01-12 14:39:29 Tree
[r4553] by cboos

Blame branch: color scale is now fully configurable

- by default use linear interpolation method suggested by mgood
- make it possible to configure `oldest_color` and `newest_color` (r,g,b) triples in the `[browser]` section of trac.ini
- in addition, it is also possible to configure an `intermediate_point` (between 0 and 1 exclusive) which can be use to position an `intermediate_color` on the color scale. This can be used to make the very newest changes to stand out.

Here's an example for using the default color scale in the [0,0.8] range of the time span, and a gradient to the "Edgewall red" for the last 20% of the newest changes:

{{{
[browser]
oldest_color = (136,136,255)
intermediate_color = (255,136,136)
newest_color = (187,0,0)
intermediate_point = 0.8
}}}

2007-01-12 14:20:52 Tree
[r4552] by athomas

Rectified `Context` nomenclature, renamed `resource` to `realm`.

2007-01-12 13:33:54 Tree
[r4551] by athomas

PermissionPolicy: Added `WikiPage().context(req)` call as a shortcut.

2007-01-12 13:16:34 Tree
Older >
Auth0 Logo