On 12/02/2011 06:18 PM, osimons wrote:
On Dec 2, 9:55 pm, Chris Nelson<[email protected]> wrote:
I can set up an extension point but my question is "where do I get the
name from that I put in trac.ini to enable/disable each instance?
Presumably, I'd use the same name in an ExtensionOption.
trac.ini:
teamcalendar.calendar.TeamCalendar = enabled
tracjsgantt.tracpm.SimpleCalendar = disabled
or in my source:
cal = ExtensionOption('TracPM',
'calendar',
IResourceCalendar,
'teamcalendar.calendar.TeamCalendar')
But those names are an educated guess and I'd rather know how to
derive/create them than hope I'm right.
The trac.ini config [component] sections should contain the full
python name/namespace of the class, module or package. So if
tracjsgantt.tracpm.SimpleCalendar is an actual component implementing
one or more interface (because tracjsgantt/tracpm.py defines or
imports a SimpleCalendar class), it will be enabled if trac.ini is
configured to enable it; as "tracjsgantt.tracpm.SimpleCalendar =
enabled", or enabling at some wildcard pattern like
"tracjsgantt.tracpm.* = enabled" to enable all classes in the module.
What about the name I give to ExtensionOption? I tried
teamcalendar.calendar.TeamCalendar and got errors. Is there any way to
inspect for the name? Have the plugin do something like:
self.env.log.info("Hi, I'm %s" % myName())
?
--
Christopher Nelson, Software Engineering Manager
SIXNET - Solutions for Your Industrial Networking Challenges
331 Ushers Road, Ballston Lake, NY 12019
Tel: +1.518.877.5173, Fax: +1.518.877.8346 www.sixnet.com
--
You received this message because you are subscribed to the Google Groups "Trac
Users" 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-users?hl=en.