Opened 13 years ago
Closed 8 years ago
#9048 closed enhancement (wontfix)
[RFC][PATCH] Policer extension point, and improvement on user preference box programming
Reported by: | Patrick Schaaf | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | AnnouncerPlugin |
Severity: | normal | Keywords: | |
Cc: | Ryan J Ollos | Trac Release: | 0.11 |
Description
This is a request for comments, and a moderately large patch to serve as a foundation for the request.
The focus is on improvements to the user preference panels, and especially on a new way to selectively remove subscribers, before announcements are distributed, under various conditions.
My trac installation and development system is still running 0.11.7, so I'm making these changes against the 0.11/ branch of AnnouncerPlugin, in the hope that code did not diverge too much to make this useless.
I'll create this ticket with the patch attached, then write a comment with more elaboration on the contained features.
I'm looking forward to any comments you might have, and directions on how likely it is to get this integrated.
Attachments (3)
Change History (8)
comment:1 Changed 13 years ago by
Changed 13 years ago by
Attachment: | announcerplugin-policer-and-shared-prefs-boxes.patch added |
---|
minimal updates
Changed 13 years ago by
Attachment: | announcerplugin-policer-and-shared-prefs-boxes-V2.patch added |
---|
respin - now with revert-user-settings-to-defaults functionality
comment:2 Changed 13 years ago by
The -V2 patch moves the user setting helpers from pref.py to a new file userpref.py.
Functionality added: when user settings are present in the settings DB, i.e. system defaults from trac.ini are overridden, a new checkbox is rendered at the right margin of the settings box, which can be checked + on submit, the settings in that line will return to their trac.ini defaults, and are removed from the DB.
Calling sites (in policer/*.py) are also cleaned up a bit, with more compact helper function signatures.
The templates use a table now - is there a better way to optionally add a right-floating checkbox that keeps vertical alignment with the settings it stands for?
Changed 13 years ago by
Attachment: | policer-settings.png added |
---|
teaser - this is how the policer settings box looks like now
comment:3 Changed 11 years ago by
Owner: | changed from Robert Corsaro to Steffen Hoffmann |
---|
comment:4 Changed 8 years ago by
Owner: | Steffen Hoffmann deleted |
---|
comment:5 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Please upgrade to Trac 1.2, which has integrated the core of AnnouncerPlugin. Please raise the issue on the trac:MailingList if you encounter the issue with Trac 1.2.
Ground covered:
IAnnouncementPolicer
A new extension point, IAnnouncementPolicer, is provided. Implementors are called after the list of all subscriptions has been built, and before the distributors are called. Implementors can then remove subscribers from the list, to suppress announcements to them by various criteria.
Interface and central implementation in api.py
The patch contains five exemplary implementations of policers. Some of them have user preferences, all going into a single box in the preferences panel.
To enable the policers, you have to put this in trac.ini:
Use the admin panel plugin configuration to selectively enable or disable them.
The five policers in the patch provide the following functions, each in a separate policer. All individual trac.ini options go to the
[announcer]
section:User Preference Boxes
While keeping the current preferences box interface, a similar, new extension point IAnnouncementPreferenceSettingProvider can be used to define, from several different implementors, settings that should go into the same box.
Interface in api.py, implementation in pref.py