Fix PIL import

This commit is contained in:
Kovid Goyal 2013-06-17 09:29:56 +05:30
parent 1bada2b35b
commit 7a0675e59a

View File

@ -86,7 +86,14 @@ def getimagesize(url):
"""
try:
import ImageFile
from PIL import ImageFile
except ImportError:
try:
import ImageFile
except ImportError:
return None
try:
import urllib2
except ImportError:
return None
@ -220,7 +227,7 @@ class Textile(object):
(re.compile(r'{(S\^|\^S)}'), r'Ŝ'), # S-circumflex
(re.compile(r'{(s\^|\^s)}'), r'ŝ'), # s-circumflex
(re.compile(r'{(S\ˇ|\ˇS)}'), r'Š'), # S-caron
(re.compile(r'{(s\ˇ|\ˇs)}'), r'š'), # s-caron
(re.compile(r'{(T\ˇ|\ˇT)}'), r'Ť'), # T-caron
@ -229,7 +236,7 @@ class Textile(object):
(re.compile(r'{(u\°|\°u)}'), r'ů'), # u-ring
(re.compile(r'{(Z\ˇ|\ˇZ)}'), r'Ž'), # Z-caron
(re.compile(r'{(z\ˇ|\ˇz)}'), r'ž'), # z-caron
(re.compile(r'{\*}'), r'•'), # bullet
(re.compile(r'{Fr}'), r'₣'), # Franc
(re.compile(r'{(L=|=L)}'), r'₤'), # Lira
@ -245,7 +252,7 @@ class Textile(object):
(re.compile(r"{(|'/|/')}"), r'’'), # closing-single-quote - apostrophe
(re.compile(r"{(|\\'|'\\)}"), r'‘'), # opening-single-quote
(re.compile(r'{(”|"/|/")}'), r'”'), # closing-double-quote
(re.compile(r'{(“|\\"|"\\)}'), r'“'), # opening-double-quote
(re.compile(r'{(“|\\"|"\\)}'), r'“'), # opening-double-quote
]
glyph_defaults = [
(re.compile(r'(\d+\'?\"?)( ?)x( ?)(?=\d+)'), r'\1\2×\3'), # dimension sign