On Apr 13, 2009, at 12:09 AM, Felix Schwarz wrote: > > Noah Kantrowitz schrieb: >> Creating the Option attributes adds those options to the central >> registry of config options. This is how things like IniAdmin and the >> TracIni macro can introspect what config options exist. > > I know this but wouldn't it make more sense (in terms of a clean > architecture) > adding these options to the TicketSystem and use it there instead of > querying > the configuration directly for these settings? > > Given that no trac module expects the option declaration in the > TicketModule, > this should be pretty easy to switch, right?
Not really, currently it uses the current field name to compute the config key to look up, so it is one relatively simple line of code. To use the actual objects would mean a nice big if/elif/etc block for every one of them or some tomfoolery with getattr which would do exactly the same thing except slower.We already have one level of indirection in the config API, so I don't think it is something we will need to change enough to make this worthwhile. --Noah --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
