1. RJ Ryan
  2. sorl-thumbnail


Chris Beaven  committed 3142db5

Remove a bunch of unused imports & variables throughout the project.

  • Participants
  • Parent commits 92a085c
  • Branches default

Comments (0)

Files changed (9)

File docs/conf.py

View file
 # All configuration values have a default; values that are commented out
 # serve to show the default.
-import sys, os
+#import sys, os
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the

File sorl/thumbnail/base.py

View file
 from tempfile import mkstemp
 from shutil import copyfile
-from PIL import Image, ImageFilter
+from PIL import Image
 from sorl.thumbnail import defaults
 from sorl.thumbnail.processors import get_valid_options, dynamic_import

File sorl/thumbnail/fields.py

View file
-import os.path
 from UserDict import DictMixin
     from cStringIO import StringIO
 from django.db.models.fields.files import ImageField, ImageFieldFile
 from django.core.files.base import ContentFile
 from django.utils.safestring import mark_safe
-from django.utils.functional import curry
 from django.utils.html import escape
-from django.conf import settings
 from sorl.thumbnail.base import Thumbnail
 from sorl.thumbnail.main import DjangoThumbnail, build_thumbnail_name

File sorl/thumbnail/management/commands/thumbnail_cleanup.py

View file
 def clean_up():
     paths = set()
     for app in models.get_apps():
-        app_name = app.__name__.split('.')[-2]
         model_list = models.get_models(app)
         for model in model_list:
             for field in model._meta.fields:

File sorl/thumbnail/templatetags/thumbnail.py

View file
 import re
 import math
-from django.template import Library, Node, Variable, VariableDoesNotExist, \
+from django.template import Library, Node, VariableDoesNotExist, \
-from django.conf import settings
-from django.utils.encoding import force_unicode
 from sorl.thumbnail.main import DjangoThumbnail, get_thumbnail_setting
 from sorl.thumbnail.processors import dynamic_import, get_valid_options
 from sorl.thumbnail.utils import split_args

File sorl/thumbnail/tests/classes.py

View file
 #! -*- coding: utf-8 -*-
-import unittest
 import os
 import time
 from StringIO import StringIO
         # Create thumbnail
         thumb_name = THUMB_NAME % 4
         thumb_size = (240, 240)
-        thumb = Thumbnail(source=PIC_NAME, dest=thumb_name,
-                          requested_size=thumb_size)
+        Thumbnail(source=PIC_NAME, dest=thumb_name, requested_size=thumb_size)
         thumb_mtime = os.path.getmtime(thumb_name)
         # Create another instance, shouldn't generate a new thumb
-        thumb = Thumbnail(source=PIC_NAME, dest=thumb_name,
-                          requested_size=thumb_size)
+        Thumbnail(source=PIC_NAME, dest=thumb_name, requested_size=thumb_size)
         self.assertEqual(os.path.getmtime(thumb_name), thumb_mtime)
         # Recreate the source image, then see if a new thumb is generated
         Image.new('RGB', PIC_SIZE).save(PIC_NAME, 'JPEG')
-        thumb = Thumbnail(source=PIC_NAME, dest=thumb_name,
-                          requested_size=thumb_size)
+        Thumbnail(source=PIC_NAME, dest=thumb_name, requested_size=thumb_size)
         self.assertNotEqual(os.path.getmtime(thumb_name), thumb_mtime)
     def testFilelikeDest(self):

File sorl/thumbnail/tests/fields.py

View file
         self.verify_thumbnail((300, 225), expected_filename=expected_filename)
         tag = model.avatar.thumbnail_tag
-        base_name = RELATIVE_PIC_NAME.replace('.', '_')
         expected_tag = ('<img src="%s" width="300" height="225" alt="" />' %
                         '/'.join([settings.MEDIA_URL.rstrip('/'), 'test',

File sorl/thumbnail/tests/templatetags.py

View file
-import unittest
 import os
-import time
-from PIL import Image
 from django.conf import settings
 from django.template import Template, Context, TemplateSyntaxError
-from sorl.thumbnail.base import ThumbnailException
 from sorl.thumbnail.tests.classes import BaseTest, RELATIVE_PIC_NAME
         return Template(source).render(context)
     def testTagInvalid(self):
-        basename = RELATIVE_PIC_NAME.replace('.', '_')
         # No args, or wrong number of args
         src = '{% thumbnail %}'
         self.assertRaises(TemplateSyntaxError, self.render_template, src)

File sorl/thumbnail/tests/utils.py

View file
-import os
 from django.conf import settings
 from sorl.thumbnail.utils import *