In Trac 0.11.6, the code quoted below results in missing options being
an empty string, not None.
http://www.edgewall.org/docs/tags-trac-0.11.7/epydoc/trac.config.Option-class.html
says:
__init__(self, section, name, default=None, doc='')
What am I missing? Or is this broken?
Chris
------------------8<--------------->8---------------
class TracPM(Component):
cfgSection = 'TracPM'
fields = None
...
Option(cfgSection, 'fields.percent', None,
"""Ticket field to use as the data source for the percent
complete column.""")
...
def __init__(self):
self.env.log.debug('Initializing TracPM')
# Configurable fields
fields = ('percent', 'estimate', 'worked', 'start', 'finish',
'pred', 'succ', 'parent')
self.fields = {}
for field in fields:
self.fields[field] = self.config.get(self.cfgSection,
'fields.%s' % field)
self.env.log.debug('%s is %s' % (field, self.fields[field]))
--
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.