Modify

Opened 3 years ago

Closed 10 months ago

Last modified 9 months ago

#13124 closed enhancement (fixed)

Use Trac 1.2 notification API

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: lkraav, ralph.phd@… Trac Release:

Description (last modified by Ryan J Ollos)

Discussed in comment:8:ticket:13074, AccountManagerPlugin should be modified to use the new notification API in Trac 1.2.

Attachments (2)

accountmanager-notification-update.diff (12.1 KB) - added by Niels Sascha Reedijk 11 months ago.
Patch to the current trunk
notification.py (8.6 KB) - added by Niels Sascha Reedijk 11 months ago.
Complete new version of notification.py

Download all attachments as: .zip

Change History (20)

comment:1 Changed 3 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 Changed 2 years ago by lkraav

Cc: lkraav added

Does this ticket mean that AccountManagerPlugin admin panel will not show up with current trunk (1.3.3-dev)?

comment:3 Changed 2 years ago by lkraav

from trac.notification.compat import NotifyEmail helped, but now more (templating?) incompatibilities appeared:

Python Traceback
Most recent call last:

File "/home/trac/src/trac-1.2.git/trac/web/main.py", line 639, in _dispatch_request          
  dispatcher.dispatch(req)
File "/home/trac/src/trac-1.2.git/trac/web/main.py", line 262, in dispatch          
  method=method)
File "/home/trac/src/trac-1.2.git/trac/web/chrome.py", line 1423, in render_template          
  fragment, iterable, method)
File "/home/trac/src/trac-1.2.git/trac/web/chrome.py", line 1482, in _render_jinja_template          
  page = self.render_template_string(template, data, text)
File "/home/trac/src/trac-1.2.git/trac/web/chrome.py", line 1652, in render_template_string          
  string = template.render(data)
File "/home/trac/trunk-2.7/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render          
  return self.environment.handle_exception(exc_info, True)
File "/home/trac/trunk-2.7/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception          
  reraise(exc_type, exc_value, tb)
File "/home/trac/src/trac-hacks.git/accountmanagerplugin/trunk/acct_mgr/templates/admin_accountsconfig.html", line 34, in top-level template code          
  (idx == active and 'active') or None}"
File "/home/trac/trunk-2.7/lib/python2.7/site-packages/jinja2/environment.py", line 430, in getattr          
  return getattr(obj, attribute)     

comment:4 Changed 2 years ago by Peter Suter

This plugin still has Genshi templates. Trac trunk now assumes Jinja templates by default. At some point these should all be ported to Jinja syntax (see trac:wiki:TracDev/PortingFromGenshiToJinja). During the transition triggering the legacy Genshi mode should also work. Mostly this happens automatically, but in some cases a small change in the plugin is required: For example this line would have to be changed to return 'admin_accountsconfig.html', data, None. (see trac:wiki:TracDev/PortingFromGenshiToJinja#PanelProviders)

You should probably open a new ticket for this though.

comment:5 Changed 2 years ago by Ryan J Ollos

In 17051:

TracAccountManager 0.5dev: Make template args compatible with Trac 1.3.2+

Refs #13124.

comment:6 Changed 2 years ago by Ryan J Ollos

More work is needed for Trac 1.3.2+ compatibility. Changes will be committed against this ticket.

Last edited 2 years ago by Ryan J Ollos (previous) (diff)

Changed 11 months ago by Niels Sascha Reedijk

Patch to the current trunk

Changed 11 months ago by Niels Sascha Reedijk

Attachment: notification.py added

Complete new version of notification.py

comment:7 Changed 11 months ago by Niels Sascha Reedijk

I added a patch that switches over to the new Notification API, and it fixes #13312 in the process. This was written against Trac 1.3.6 and not tested against the API of 1.2. The minimum Trac version will probably have to be updated, I did not make any provisions to run on an older version of the Trac API.

comment:8 Changed 11 months ago by Ryan J Ollos

Status: newaccepted

comment:9 Changed 10 months ago by Ryan J Ollos

#13606 closed as a duplicate. I will get this patch reviewed and committed soon.

comment:10 Changed 10 months ago by Ralph <ralph.phd@…>

Cc: ralph.phd@… added

Adding myself to cc; thanks for looking into this.

comment:11 Changed 10 months ago by Ryan J Ollos

In 17492:

TracAccountManager 0.5.1dev: Adapt to Trac 1.2 notification system

Refs #13312, #13124.

comment:12 Changed 10 months ago by Ryan J Ollos

In 17493:

TracAccountManager 0.5.1dev: Bump version requirement to Trac 1.2

Refs #13124.

comment:13 Changed 10 months ago by Ryan J Ollos

In 17495:

TracAccountManager 0.6dev: Bump trunk to version 0.6

The trunk only supports Trac >= 1.2 since r17492.

Refs #13312, #13124.

comment:14 Changed 10 months ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

If you've selectively enabled AccountManager components, be sure to have acct_mgr.notification.* = enabled with TracAccountManager 0.6dev.

If you find any issues with the latest changes, please comment here and I'll try to address them quickly.

I made a branch with Trac 1.0 support in r17494, but I don't plan to do any more work supporting Trac 1.0.

Last edited 10 months ago by Ryan J Ollos (previous) (diff)

comment:15 Changed 10 months ago by Ryan J Ollos

#13610 closed as a duplicate.

comment:16 Changed 10 months ago by Ryan J Ollos

In 17506:

TracAccountManager 0.6dev: Refactor r17492

Refs #13312, #13124.

comment:17 Changed 10 months ago by Ryan J Ollos

In 17507:

TracAccountManager 0.6dev: Use [notification] smtp_subject_prefix

Refs #13124.

comment:18 Changed 9 months ago by figaro

#13620 closed as a duplicate.

Modify Ticket

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

Add Comment


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

 
Note: See TracTickets for help on using tickets.