mirror of
https://github.com/django/django.git
synced 2025-09-21 18:00:45 +00:00
Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for the work on the patch and Alex for reviewing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
956da729d1
commit
24f4764a48
242 changed files with 308 additions and 485 deletions
|
@ -1,8 +1,16 @@
|
|||
import re
|
||||
from gzip import GzipFile
|
||||
from htmlentitydefs import name2codepoint
|
||||
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
from StringIO import StringIO
|
||||
|
||||
from django.utils.encoding import force_unicode
|
||||
from django.utils.functional import allow_lazy
|
||||
from django.utils.translation import ugettext_lazy, ugettext as _
|
||||
from htmlentitydefs import name2codepoint
|
||||
|
||||
|
||||
# Capitalizes the first letter of a string.
|
||||
capfirst = lambda x: x and force_unicode(x)[0].upper() + force_unicode(x)[1:]
|
||||
|
@ -180,9 +188,8 @@ phone2numeric = allow_lazy(phone2numeric)
|
|||
# From http://www.xhaus.com/alan/python/httpcomp.html#gzip
|
||||
# Used with permission.
|
||||
def compress_string(s):
|
||||
import cStringIO, gzip
|
||||
zbuf = cStringIO.StringIO()
|
||||
zfile = gzip.GzipFile(mode='wb', compresslevel=6, fileobj=zbuf)
|
||||
zbuf = StringIO()
|
||||
zfile = GzipFile(mode='wb', compresslevel=6, fileobj=zbuf)
|
||||
zfile.write(s)
|
||||
zfile.close()
|
||||
return zbuf.getvalue()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue