mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Drop Python 2 and Django 1.11 support
Minimum supported versions are now Django 2.0, Python 3.5. This touches a lot of code, to: * Remove obsolete portability code and workarounds (six, backports of email parsers, test utils, etc.) * Use Python 3 syntax (class defs, raise ... from, etc.) * Correct inheritance for mixin classes * Fix outdated docs content and links * Suppress Python 3 "unclosed SSLSocket" ResourceWarnings that are beyond our control (in integration tests due to boto3, python-sparkpost)
This commit is contained in:
@@ -7,7 +7,7 @@ from django.core.mail import EmailMessage, EmailMultiAlternatives, make_msgid
|
||||
from .utils import UNSET
|
||||
|
||||
|
||||
class AnymailMessageMixin(object):
|
||||
class AnymailMessageMixin(EmailMessage):
|
||||
"""Mixin for EmailMessage that exposes Anymail features.
|
||||
|
||||
Use of this mixin is optional. You can always just set Anymail
|
||||
@@ -32,8 +32,7 @@ class AnymailMessageMixin(object):
|
||||
self.merge_metadata = kwargs.pop('merge_metadata', UNSET)
|
||||
self.anymail_status = AnymailStatus()
|
||||
|
||||
# noinspection PyArgumentList
|
||||
super(AnymailMessageMixin, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def attach_inline_image_file(self, path, subtype=None, idstring="img", domain=None):
|
||||
"""Add inline image from file path to an EmailMessage, and return its content id"""
|
||||
@@ -82,7 +81,7 @@ ANYMAIL_STATUSES = [
|
||||
]
|
||||
|
||||
|
||||
class AnymailRecipientStatus(object):
|
||||
class AnymailRecipientStatus:
|
||||
"""Information about an EmailMessage's send status for a single recipient"""
|
||||
|
||||
def __init__(self, message_id, status):
|
||||
@@ -90,7 +89,7 @@ class AnymailRecipientStatus(object):
|
||||
self.status = status # one of ANYMAIL_STATUSES, or None for not yet sent to ESP
|
||||
|
||||
|
||||
class AnymailStatus(object):
|
||||
class AnymailStatus:
|
||||
"""Information about an EmailMessage's send status for all recipients"""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
Reference in New Issue
Block a user