Edgewall Software

Opened 17 years ago

Closed 17 years ago

#100 closed enhancement (wontfix)

Expose the genshi.template.eval.BUILTINS dictionary

Reported by: james.harris@… Owned by: cmlenz
Priority: minor Milestone:
Component: General Version: 0.3.6
Keywords: Cc: james.harris@…

Description

If this dict was exposed to the library user, it could be used to inject new 'globals' into the template context. (This proposed change is more about advertising the feature as something that is intended to be possible, rather than adding new functionality.)

It could be as simple as including something like the following in template/__init__.py.

from genshi.template.eval import BUILTINS as global_context

Change History (1)

comment:1 Changed 17 years ago by cmlenz

  • Milestone 0.4 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

The BUILTINS is an implementation detail that I'd rather not encourage modifying in any way. One problem is that it's a global, and thus modifying it is not safe in multi-threaded environments. I'd prefer that frameworks/applications embedding Genshi provide their own means for registering variables that should be available by default in templates.

Note: See TracTickets for help on using tickets.