2012-11-06 04:34:32 +00:00
|
|
|
# flake8: noqa
|
|
|
|
|
|
2009-01-08 21:11:15 +00:00
|
|
|
# Required PIL classes may or may not be available from the root namespace
|
|
|
|
|
# depending on the installation method used.
|
|
|
|
|
try:
|
2011-11-16 04:42:43 +00:00
|
|
|
from PIL import Image, ImageColor, ImageChops, ImageEnhance, ImageFile, \
|
|
|
|
|
ImageFilter, ImageDraw, ImageStat
|
2009-01-08 21:11:15 +00:00
|
|
|
except ImportError:
|
|
|
|
|
try:
|
2011-10-13 05:35:16 +00:00
|
|
|
import Image
|
|
|
|
|
import ImageColor
|
2011-11-09 21:23:04 +00:00
|
|
|
import ImageChops
|
2011-10-13 05:35:16 +00:00
|
|
|
import ImageEnhance
|
|
|
|
|
import ImageFile
|
|
|
|
|
import ImageFilter
|
2011-11-16 04:42:43 +00:00
|
|
|
import ImageDraw
|
|
|
|
|
import ImageStat
|
2009-01-08 21:11:15 +00:00
|
|
|
except ImportError:
|
2009-12-19 16:01:54 +00:00
|
|
|
raise ImportError('ImageKit was unable to import the Python Imaging Library. Please confirm it`s installed and available on your current Python path.')
|
2012-05-12 19:45:08 +00:00
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
from cStringIO import StringIO
|
|
|
|
|
except ImportError:
|
|
|
|
|
from StringIO import StringIO
|
2013-05-20 23:18:35 +00:00
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
from logging import NullHandler
|
|
|
|
|
except ImportError:
|
|
|
|
|
from logging import Handler
|
|
|
|
|
|
|
|
|
|
class NullHandler(Handler):
|
|
|
|
|
def emit(self, record):
|
|
|
|
|
pass
|