On 03/21/2012 02:36 PM, Chris Nelson wrote:
... But how do I make sure that only one sorter is
enabled? Do I have to resort to something like:
sorters = ExtensionPoint(ITaskSorter)
count = 0
for sorter i self.sorters:
count++
theSorter = sorter
if count > 1:
...raise an error...
? ...
Granted that this may be a strange way to program Trac, it seems like it
is valid. But when I do:
self.sorters = ExtensionPoint(ITaskSorter)
i = 0
for s in self.sorters:
i += 1
self.env.log.debug('Found %d enabled sorters' % i)
I get:
'ExtensionPoint' object is not iterable
I'm in Trac 0.11.6 but I Googled uses of ExtensionPoint and there seem
to be some quite old ones in the style that iterates over an
ExtensionPoint. What am I doing wrong?
Chris
--
Christopher Nelson, Software Engineering Manager
Sixnet, a Red Lion business | www.sixnet.com
+1 (518) 877-5173, x135
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to trac-dev@googlegroups.com.
To unsubscribe from this group, send email to
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en.