Edgewall Software

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11854 closed enhancement (fixed)

Split up notification module

Reported by: Peter Suter Owned by: Peter Suter
Priority: normal Milestone: 1.1.3
Component: notification Version:
Severity: normal Keywords:
Cc: Ryan J Ollos Branch:
Release Notes:

Split up trac.notification module into a package of sub-modules.

API Changes:

Added mail notification helper functions create_charset, create_mime_text, create_header, create_message_id, and class RecipientMatcher (matches recipients taking into account admit_domains, ignore_domains, use_short_addr and smtp_default_domain config options).

Internal Changes:


The Advanced Notification proposal starts with splitting up the trac/notification.py into:

  • trac/notification/api.py containing interface definitions and the NotificationSystem.
  • trac/notification/mail.py containing any email specific functionality like SmtpEmailSender and SendmailEmailSender.
  • trac/notification/compat.py containing the Notify / NotifyEmail base classes. (After #3517 these and TicketNotifyEmail would only remain for backward compatibility and could be deprecated and removed later.)

For backwards compatibility these will also be imported in trac/notification/__init__.py.

I'd also like to extract some useful pieces from NotifyEmail and TicketNotifyEmail into trac/notification/mail.py, so we can reuse them later.

The proposed changes are in log:psuter@advanced-notification-preliminary-refactorings.

Attachments (0)

Change History (7)

comment:1 by Peter Suter, 10 years ago

Owner: set to Peter Suter
Status: newassigned

comment:2 by Peter Suter, 10 years ago

API Changes: modified (diff)
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to trunk in [13433].

comment:3 by Ryan J Ollos, 10 years ago

It looks like NotificationSystem has an indirect import. Any reason for that, or was it just an oversight?

  • trac/notification/__init__.py

    diff --git a/trac/notification/__init__.py b/trac/notification/__init__.py
    index 2a44766..efb9c2b 100644
    a b  
    1212# history and logs, available at http://trac.edgewall.org/log/.
    1414# Imports for backward compatibility
    15 from trac.notification.api import IEmailSender
    16 from trac.notification.compat import NotificationSystem, Notify, NotifyEmail
     15from trac.notification.api import IEmailSender, NotificationSystem
     16from trac.notification.compat import Notify, NotifyEmail
    1717from trac.notification.mail import (EMAIL_LOOKALIKE_PATTERN, MAXHEADERLEN,
    1818                                    SmtpEmailSender, SendmailEmailSender)

comment:4 by Ryan J Ollos, 10 years ago

Cc: Ryan J Ollos added

in reply to:  3 comment:5 by Peter Suter, 10 years ago

Replying to rjollos:

It looks like NotificationSystem has an indirect import. Any reason for that, or was it just an oversight?

Just an oversight. I don't recall any special intent. Please commit, thanks.

comment:6 by Peter Suter, 10 years ago

It seems this is from Jun's cleanup in #4056, so I might also have missed the intent.

Last edited 10 years ago by Peter Suter (previous) (diff)

comment:7 by Ryan J Ollos, 10 years ago

Thanks for feedback, I committed [13652].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Peter Suter.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Peter Suter 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.