2013-11-09 02:42:06 +00:00
|
|
|
import re
|
|
|
|
|
2014-08-05 06:41:04 +00:00
|
|
|
VERSION = (0, 4, 3)
|
2013-11-09 02:42:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
def get_version(svn=False):
|
|
|
|
"Returns the version as a human-format string."
|
|
|
|
return '.'.join([str(i) for i in VERSION])
|
|
|
|
|
|
|
|
|
|
|
|
def pillow_required():
|
|
|
|
def pil_version(version):
|
|
|
|
try:
|
|
|
|
return int(re.compile('[^\d]').sub('', version))
|
|
|
|
except:
|
|
|
|
return 116
|
|
|
|
|
|
|
|
try:
|
|
|
|
from PIL import Image, ImageDraw, ImageFont
|
|
|
|
except ImportError:
|
|
|
|
try:
|
|
|
|
import Image
|
2014-08-05 06:41:04 +00:00
|
|
|
import ImageDraw # NOQA
|
|
|
|
import ImageFont # NOQA
|
2013-11-09 02:42:06 +00:00
|
|
|
except ImportError:
|
|
|
|
return True
|
|
|
|
|
|
|
|
return pil_version(Image.VERSION) < 116
|