Fixed a bunch of imports of the email stdlib module now that we are on Python 2.5 to ease the Python 3 port. Thanks, Martin von Löwis.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16731 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
387e192f25
commit
ddaca29d3d
|
@ -1,8 +1,9 @@
|
||||||
"Misc. utility functions/classes for admin documentation generator."
|
"Misc. utility functions/classes for admin documentation generator."
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from email.Parser import HeaderParser
|
from email.parser import HeaderParser
|
||||||
from email.Errors import HeaderParseError
|
from email.errors import HeaderParseError
|
||||||
|
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.utils.encoding import smart_str
|
from django.utils.encoding import smart_str
|
||||||
|
|
|
@ -4,7 +4,7 @@ from django import forms
|
||||||
from django.forms.util import ErrorDict
|
from django.forms.util import ErrorDict
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from models import Comment
|
from django.contrib.comments.models import Comment
|
||||||
from django.utils.crypto import salted_hmac, constant_time_compare
|
from django.utils.crypto import salted_hmac, constant_time_compare
|
||||||
from django.utils.encoding import force_unicode
|
from django.utils.encoding import force_unicode
|
||||||
from django.utils.text import get_text_list
|
from django.utils.text import get_text_list
|
||||||
|
|
|
@ -139,7 +139,7 @@ class DatabaseCache(BaseDatabaseCache):
|
||||||
if connections[db].vendor == 'oracle':
|
if connections[db].vendor == 'oracle':
|
||||||
# Special case for Oracle because it doesn't support LIMIT + OFFSET
|
# Special case for Oracle because it doesn't support LIMIT + OFFSET
|
||||||
cursor.execute("SELECT cache_key FROM (SELECT ROW_NUMBER() OVER (ORDER BY cache_key) AS counter, cache_key FROM %s) WHERE counter > %%s AND COUNTER <= %%s" % table, [cull_num, cull_num + 1])
|
cursor.execute("SELECT cache_key FROM (SELECT ROW_NUMBER() OVER (ORDER BY cache_key) AS counter, cache_key FROM %s) WHERE counter > %%s AND COUNTER <= %%s" % table, [cull_num, cull_num + 1])
|
||||||
else:
|
else:
|
||||||
# This isn't standard SQL, it's likely to break with some non officially supported databases
|
# This isn't standard SQL, it's likely to break with some non officially supported databases
|
||||||
cursor.execute("SELECT cache_key FROM %s ORDER BY cache_key LIMIT 1 OFFSET %%s" % table, [cull_num])
|
cursor.execute("SELECT cache_key FROM %s ORDER BY cache_key LIMIT 1 OFFSET %%s" % table, [cull_num])
|
||||||
cursor.execute("DELETE FROM %s WHERE cache_key < %%s" % table, [cursor.fetchone()[0]])
|
cursor.execute("DELETE FROM %s WHERE cache_key < %%s" % table, [cursor.fetchone()[0]])
|
||||||
|
|
|
@ -2,13 +2,13 @@ import mimetypes
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
from email import Charset, Encoders
|
from email import charset as Charset, encoders as Encoders
|
||||||
from email.generator import Generator
|
from email.generator import Generator
|
||||||
from email.MIMEText import MIMEText
|
from email.mime.text import MIMEText
|
||||||
from email.MIMEMultipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.MIMEBase import MIMEBase
|
from email.mime.base import MIMEBase
|
||||||
from email.Header import Header
|
from email.header import Header
|
||||||
from email.Utils import formatdate, getaddresses, formataddr, parseaddr
|
from email.utils import formatdate, getaddresses, formataddr, parseaddr
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.mail.utils import DNS_NAME
|
from django.core.mail.utils import DNS_NAME
|
||||||
|
|
|
@ -78,7 +78,7 @@ class Command(BaseCommand):
|
||||||
return zipfile.ZipFile.read(self, self.namelist()[0])
|
return zipfile.ZipFile.read(self, self.namelist()[0])
|
||||||
|
|
||||||
compression_types = {
|
compression_types = {
|
||||||
None: file,
|
None: open,
|
||||||
'gz': gzip.GzipFile,
|
'gz': gzip.GzipFile,
|
||||||
'zip': SingleZipReader
|
'zip': SingleZipReader
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import re
|
||||||
import sys
|
import sys
|
||||||
import urllib
|
import urllib
|
||||||
import urlparse
|
import urlparse
|
||||||
from email.Utils import formatdate
|
from email.utils import formatdate
|
||||||
|
|
||||||
from django.utils.datastructures import MultiValueDict
|
from django.utils.datastructures import MultiValueDict
|
||||||
from django.utils.encoding import smart_str, force_unicode
|
from django.utils.encoding import smart_str, force_unicode
|
||||||
|
|
Loading…
Reference in New Issue