Commits

Chris Beaven committed 3142db5

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

Comments (0)

Files changed (9)

 # 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

sorl/thumbnail/base.py

 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

sorl/thumbnail/fields.py

-import os.path
 from UserDict import DictMixin
 try:
     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

sorl/thumbnail/management/commands/thumbnail_cleanup.py

 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:

sorl/thumbnail/templatetags/thumbnail.py

 import re
 import math
-from django.template import Library, Node, Variable, VariableDoesNotExist, \
+from django.template import Library, Node, VariableDoesNotExist, \
     TemplateSyntaxError
-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

sorl/thumbnail/tests/classes.py

 #! -*- 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)
         self.images_to_delete.add(thumb_name)
         thumb_mtime = os.path.getmtime(thumb_name)
         time.sleep(1)
 
         # 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):

sorl/thumbnail/tests/fields.py

         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',
                                   dest_name]))

sorl/thumbnail/tests/templatetags.py

-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)

sorl/thumbnail/tests/utils.py

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