Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#3050 closed defect (fixed)

Minor fix for newly added ExtensionOption

Reported by: Alec Thomas Owned by: Christopher Lenz
Priority: normal Milestone: 0.10
Component: general Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The current implementation assumes the default is a class, but the uses of it assume it is a string:

  • trac/config.py

     
    349349        if instance is None:
    350350            return self
    351351        value = Option.__get__(self, instance, owner)
     352        if self.default is not None:
     353            value = self.default
    352354        for impl in self.xtnpt.extensions(instance):
    353355            if impl.__class__.__name__ == value:
    354356                return impl
    355         if self.default is not None:
    356             return self.default(instance.env)
    357357        raise AttributeError('Cannot find an implementation of the "%s" '
    358358                             'interface named "%s".  Please update the option '
    359359                             '%s.%s in trac.ini.'

Attachments (0)

Change History (3)

comment:1 by Christopher Lenz, 19 years ago

Milestone: 0.10
Status: newassigned

That would make the default always override the actual value… I think it should suffice to remove the two lines your patch removes, as the default should already be handled by Option.__get__.

comment:2 by Alec Thomas, 19 years ago

Heh yeah, whoops.

comment:3 by Alec Thomas, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r3192.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.