mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-05 00:13:42 +03:00
PEP8 fixes
This commit is contained in:
parent
1e686fddf9
commit
3c7f9152c6
17
setup.py
17
setup.py
|
@ -6,7 +6,14 @@
|
|||
# Usage: python setup.py install
|
||||
#
|
||||
|
||||
import glob, os, re, struct, string, sys, platform
|
||||
import glob
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import struct
|
||||
import string
|
||||
import sys
|
||||
|
||||
|
||||
def libinclude(root):
|
||||
# map root to (root/lib, root/include)
|
||||
|
@ -80,6 +87,7 @@ try:
|
|||
except ImportError:
|
||||
_tkinter = None
|
||||
|
||||
|
||||
def add_directory(path, dir, where=None):
|
||||
if dir and os.path.isdir(dir) and dir not in path:
|
||||
if where is None:
|
||||
|
@ -87,15 +95,18 @@ def add_directory(path, dir, where=None):
|
|||
else:
|
||||
path.insert(where, dir)
|
||||
|
||||
|
||||
def find_include_file(self, include):
|
||||
for directory in self.compiler.include_dirs:
|
||||
if os.path.isfile(os.path.join(directory, include)):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
def find_library_file(self, library):
|
||||
return self.compiler.find_library_file(self.compiler.library_dirs, library)
|
||||
|
||||
|
||||
def find_version(filename):
|
||||
for line in open(filename).readlines():
|
||||
m = re.search("VERSION\s*=\s*\"([^\"]+)\"", line)
|
||||
|
@ -106,6 +117,7 @@ def find_version(filename):
|
|||
#VERSION = find_version("PIL/Image.py")
|
||||
VERSION = "1.2"
|
||||
|
||||
|
||||
class pil_build_ext(build_ext):
|
||||
|
||||
def build_extensions(self):
|
||||
|
@ -234,7 +246,8 @@ class pil_build_ext(build_ext):
|
|||
if find_include_file(self, "jpeglib.h"):
|
||||
if find_library_file(self, "jpeg"):
|
||||
feature.jpeg = "jpeg"
|
||||
elif sys.platform == "win32" and find_library_file(self, "libjpeg"):
|
||||
elif sys.platform == "win32" and find_library_file(self,
|
||||
"libjpeg"):
|
||||
feature.jpeg = "libjpeg" # alternative name
|
||||
|
||||
if find_library_file(self, "tiff"):
|
||||
|
|
Loading…
Reference in New Issue
Block a user