Modify

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#13233 closed defect (fixed)

FlexibleAssignToPlugin not compatible with Trac 1.2

Reported by: Jon Ashley Owned by: Ryan J Ollos
Priority: normal Component: FlexibleAssignToPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

FlexibleAssignToPlugin won't work with Trac 1.2, because the tuple _TRUE_VALUES has been removed from trac/config.py.

A simple fix is to declare a replacement for _TRUE_VALUES in the plugin itself.

Attachments (0)

Change History (11)

comment:1 Changed 5 months ago by Ryan J Ollos

In 16702:

FlexibleAssignTo 0.8.13: Replace us of deprecated _TRUE_VALUES

Refs #13233.

comment:2 Changed 5 months ago by Ryan J Ollos

r16702 is untested. Please let me know if the change works for you.

comment:3 Changed 5 months ago by Ryan J Ollos

In 16704:

FlexibleAssignTo 0.8.13: Conform to PEP8

Refs #13233.

comment:4 Changed 5 months ago by Jon Ashley

Two review comments:

  • The function getbool() in flexibleassignto.py is now unused so should be deleted.
  • The __init__.py file needs to contain the statement
    from flexibleassignto import *
    
    or similar, otherwise the user-provided implementation of IValidOwnerProvider cannot load.

comment:5 in reply to:  4 ; Changed 5 months ago by Ryan J Ollos

Replying to Jon Ashley:

  • The function getbool() in flexibleassignto.py is now unused so should be deleted.

I realized it wasn't used but left it because removing it could break someone's IValidOwnerProvider implementation if they are using the function.

  • The __init__.py file needs to contain the statement
    from flexibleassignto import *
    
    or similar, otherwise the user-provided implementation of IValidOwnerProvider cannot load.

I expected that a user would create a single-file plugin that uses the API rather than adding their code to this plugin and recompiling the egg/wheel. No problem to add it back, I suppose.

comment:6 in reply to:  5 ; Changed 5 months ago by Jon Ashley

Replying to Ryan J Ollos:

I expected that a user would create a single-file plugin that uses the API rather than adding their code to this plugin and recompiling the egg/wheel. No problem to add it back, I suppose.

The way the plugin is used at my site is that the egg file is compiled from the plugin and placed in the Trac environment's plugin folder, then the LocalValidOwnerProvider.py file is also placed in the Trac environment's plugin folder. It's not managed as part of the plugin and doesn't end up in the egg file.

That sounds like the situation you are expecting, but that's what isn't working unless the IValidOwnerProvider name is exported in the __init__.py file.

comment:7 in reply to:  6 Changed 5 months ago by Ryan J Ollos

Replying to Jon Ashley:

That sounds like the situation you are expecting, but that's what isn't working unless the IValidOwnerProvider name is exported in the __init__.py file.

Yes, I see. Generally the * import isn't needed in __init__.py if you modify the entry point appropriately, but in this case if you expect to do flexibleassignto import IValidOwnerProvider rather than flexibleassignto.flexibleassignto import IValidOwnerProvider, the * import is needed.

comment:8 Changed 5 months ago by Ryan J Ollos

In 16706:

FlexibleAssignTo 0.8.13: Fix export of interface and cleanup setup.py

Refs #13233.

comment:9 Changed 5 months ago by Jon Ashley

This now works for me. I hadn't considered that other users of the plugin might be relying on getbool().

comment:10 in reply to:  9 Changed 5 months ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Replying to Jon Ashley:

This now works for me.

Thanks for the feedback!

I hadn't considered that other users of the plugin might be relying on getbool().

I doubt it will affect anyone either way, but I considered it was just easier to be on the safe side of things.

comment:11 Changed 5 months ago by Ryan J Ollos

Owner: set to Ryan J Ollos

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.