|Version 2 (modified by 14 years ago) ( diff ),|
This page is aimed to help plugin developers to port their 0.9 plugin to Trac 0.10.
The most important single change in 0.10 was the switch to using
unicode everywhere internally.
New Configuration API for Components
Components can still use
self.config.get..., but there's now a better way to do this,
which among other things make it easy to document your configuration settings.
When you had:
class DoxygenPlugin(Component): implements(...) # ... def match_request(self, req): # Get config variables. base_path = self.config.get('doxygen', 'path', '/var/lib/trac/doxygen')
You should now write:
class DoxygenPlugin(Component): implements(...) base_path = Option('doxygen', 'path', '/var/lib/trac/doxygen', """Directory containing doxygen generated files.""") # ... def match_request(self, req): base_path = self.base_path # actually, use `self.base_path` where you'd used `base_path`
By using the TracIni(doxygen) macro, you'll get the documentation for all your settings.
get_search_results(self, req, terms, filters) now takes a list of
terms instead of the full
query, as it used to do for its second argument.
212 212 213 213 yield('doxygen', title) 214 214 215 def get_search_results(self, req, query, filters): 215 def get_search_results(self, req, , filters): 216 216 if not 'doxygen' in filters: 217 217 return 218 if query == query[-1] == "'" or query == query[-1] == '"': 219 keywords = [query[1:-1]] 220 else: 221 keywords = query.split(' ') 222 218 223 219 base_path = self.config.get('doxygen', 'path')
See also: TracDev/ReleaseNotes/0.10