Merge pull request #99 from cyberdelia/pep8-import-fixes

Fix import and formatting
This commit is contained in:
Matthew Tretter 2012-02-14 08:44:50 -08:00
commit 082cf6a1bb
4 changed files with 6 additions and 4 deletions

View file

@ -74,7 +74,7 @@ def get_default_image_cache_backend():
except ValueError:
raise ImproperlyConfigured("%s isn't an image cache backend module." % \
import_path)
module, classname = import_path[:dot], import_path[dot+1:]
module, classname = import_path[:dot], import_path[dot + 1:]
try:
mod = import_module(module)
except ImportError, e:

View file

@ -1,3 +1,5 @@
import os
from django.db import models
from django.db.models.signals import post_init, post_save, post_delete

View file

@ -1,7 +1,7 @@
import os
import datetime
from django.db.models.fields.files import ImageFieldFile
from django.db.models.fields.files import ImageField, ImageFieldFile
from django.utils.encoding import force_unicode, smart_str
@ -19,7 +19,7 @@ class ImageSpecFieldFile(ImageFieldFile):
else:
image_fields = [getattr(self.instance, f.attname) for f in \
self.instance.__class__._meta.fields if \
isinstance(f, models.ImageField)]
isinstance(f, ImageField)]
if len(image_fields) == 0:
raise Exception('%s does not define any ImageFields, so your' \
' %s ImageSpecField has no image to act on.' % \

View file

@ -154,7 +154,7 @@ class Fit(object):
img = BasicResize(new_dimensions[0],
new_dimensions[1]).process(img)
if self.mat_color:
new_img = Image.new('RGBA', (self.width, self.height), self.mat_color)
new_img = Image.new('RGBA', (self.width, self.height), self.mat_color)
new_img.paste(img, ((self.width - img.size[0]) / 2, (self.height - img.size[1]) / 2))
img = new_img
return img