Edgewall Software
Home
Trac
Trac Hacks
Genshi
Babel
Bitten
Home
Download
Documentation
Mailing Lists
License
FAQ
Search:
Login
Preferences
Help/Guide
About Trac
Wiki
Timeline
Roadmap
Browse Source
View Tickets
New Ticket
Search
Context Navigation
-1
Start Page
Index
History
Editing TracDev/Options
Adjust edit area height:
8
12
16
20
24
28
32
36
40
Edit side-by-side
This page describes how to work with options or settings stored in `trac.ini` from your Plugin. Feel free to expand. Trac plugins don't have access to some kind of global options. Options are only available for plugin components through the `self.config` [wiki:TracDev/PluginDevelopment#Componentmembervariables property]. This property is magically (i.e. implicitly) injected into component when it is created - see [wiki:TracDev/ComponentArchitecture#component_lifecycle activation chapter] for details. `self.config` is an instance of [source:trunk/trac/config.py trac.config.Configuration] class. === Get option value [source:trunk/trac/config.py trac.config.Configuration] is a subclass of [http://docs.python.org/library/configparser.html ConfigParser] from standard Python library, therefore all its methods and more are accessible. {{{ # inside component self.config.get('section', 'option', 'default') }}}
Note:
See
WikiFormatting
and
TracWiki
for help on editing wiki content.
Change information
Your email or username:
E-mail address and name can be saved in the
Preferences
Comment about this change (optional):
Note:
See
TracWiki
for help on using the wiki.