[[PageOutline]] = TracDev/ApiChanges/0.10 = This page is aimed to help plugin developers to port their 0.9 plugin to Trac 0.10. == General Changes == === Use `unicode` strings === The most important single change in 0.10 was the switch to using `unicode` everywhere internally. See TracDev/UnicodeGuidelines. === 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: {{{ #!python 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: {{{ #!python 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` }}} Besides the string `Option`, you have also access to more specialized types for you configuration settings, like `BoolOption`, `IntOption`, `ListOption`, etc. (see [source:trunk/trac/config.py@head#L326 config.py]). By using the [WikiMacros#TracIni-macro TracIni(doxygen)] macro, you'll get the documentation for all your settings. == Interface Changes == === `ISearchSource` ^[source:trunk/trac/Search.py@head#L30 (0.10)] [source:branches/0.9-stable/trac/Search.py@head#L29 (0.9)]^ === #ISearchSource The `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. Example: [trachacks:DoxygenPlugin] {{{ #!diff --- doxygentrac/doxygentrac.py Tue Aug 29 14:03:33 2006 +0200 +++ doxygentrac/doxygentrac.py Tue Aug 29 14:04:10 2006 +0200 @@ -212,13 +212,9 @@ yield('doxygen', title) - def get_search_results(self, req, query, filters): + def get_search_results(self, req, keywords, filters): if not 'doxygen' in filters: return - if query[0] == query[-1] == "'" or query[0] == query[-1] == '"': - keywords = [query[1:-1]] - else: - keywords = query.split(' ') base_path = self.config.get('doxygen', 'path') }}} ---- See also: ["TracDev/ReleaseNotes/0.10"]