merged pull request #88 to master, resolved conflicts

This commit is contained in:
wiredfool 2013-04-08 20:31:28 -07:00
parent e969b5ae14
commit c774f9ab4c
9 changed files with 23 additions and 21 deletions

View File

@ -53,7 +53,7 @@ try:
# the "open" function to identify files, but you cannot load # the "open" function to identify files, but you cannot load
# them. Note that other modules should not refer to _imaging # them. Note that other modules should not refer to _imaging
# directly; import Image and use the Image.core variable instead. # directly; import Image and use the Image.core variable instead.
import _imaging as core from . import _imaging as core
except ImportError as v: except ImportError as v:
core = _imaging_not_installed() core = _imaging_not_installed()
if str(v)[:20] == "Module use of python" and warnings: if str(v)[:20] == "Module use of python" and warnings:

View File

@ -82,7 +82,7 @@ VERSION = "0.1.0 pil"
# --------------------------------------------------------------------. # --------------------------------------------------------------------.
from PIL import Image from PIL import Image
import _imagingcms from . import _imagingcms
core = _imagingcms core = _imagingcms

View File

@ -315,7 +315,7 @@ def getdraw(im=None, hints=None):
handler = None handler = None
if not hints or "nicest" in hints: if not hints or "nicest" in hints:
try: try:
import _imagingagg as handler from PIL import _imagingagg as handler
except ImportError: except ImportError:
pass pass
if handler is None: if handler is None:

View File

@ -36,7 +36,7 @@ class _imagingft_not_installed:
raise ImportError("The _imagingft C module is not installed") raise ImportError("The _imagingft C module is not installed")
try: try:
import _imagingft as core from PIL import _imagingft as core
except ImportError: except ImportError:
core = _imagingft_not_installed() core = _imagingft_not_installed()

View File

@ -17,7 +17,7 @@
# extensions.) # extensions.)
## ##
import _imaginggl from . import _imaginggl
## ##
# Texture factory. # Texture factory.
@ -25,4 +25,4 @@ import _imaginggl
class TextureFactory: class TextureFactory:
pass # overwritten by the _imaginggl module pass # overwritten by the _imaginggl module
from _imaginggl import * from ._imaginggl import *

View File

@ -16,7 +16,7 @@
# #
from PIL import Image from PIL import Image
import _imagingmath from . import _imagingmath
import sys import sys
try: try:

View File

@ -28,7 +28,9 @@
try: try:
import tkinter import tkinter
except ImportError: except ImportError:
import Tkinter as tkinter import Tkinter
tkinter = Tkinter
del Tkinter
from PIL import Image from PIL import Image
@ -183,7 +185,7 @@ class PhotoImage:
except tkinter.TclError as v: except tkinter.TclError as v:
# activate Tkinter hook # activate Tkinter hook
try: try:
import _imagingtk from PIL import _imagingtk
try: try:
_imagingtk.tkinit(tk.interpaddr(), 1) _imagingtk.tkinit(tk.interpaddr(), 1)
except AttributeError: except AttributeError:

View File

@ -182,13 +182,13 @@ if __name__ == "__main__":
print("Python modules loaded from", os.path.dirname(Image.__file__)) print("Python modules loaded from", os.path.dirname(Image.__file__))
print("Binary modules loaded from", os.path.dirname(Image.core.__file__)) print("Binary modules loaded from", os.path.dirname(Image.core.__file__))
print("-"*68) print("-"*68)
check_module("PIL CORE", "_imaging") check_module("PIL CORE", "PIL._imaging")
check_module("TKINTER", "_imagingtk") check_module("TKINTER", "PIL._imagingtk")
check_codec("JPEG", "jpeg") check_codec("JPEG", "jpeg")
check_codec("ZLIB (PNG/ZIP)", "zip") check_codec("ZLIB (PNG/ZIP)", "zip")
check_codec("G4 TIFF", "group4") check_codec("G4 TIFF", "group4")
check_module("FREETYPE2", "_imagingft") check_module("FREETYPE2", "PIL._imagingft")
check_module("LITTLECMS", "_imagingcms") check_module("LITTLECMS", "PIL._imagingcms")
check_module("WEBP", "_webp") check_module("WEBP", "_webp")
print("-"*68) print("-"*68)

View File

@ -304,7 +304,7 @@ class pil_build_ext(build_ext):
defs.append(("WORDS_BIGENDIAN", None)) defs.append(("WORDS_BIGENDIAN", None))
exts = [(Extension( exts = [(Extension(
"_imaging", files, libraries=libs, define_macros=defs))] "PIL._imaging", files, libraries=libs, define_macros=defs))]
# #
# additional libraries # additional libraries
@ -314,19 +314,19 @@ class pil_build_ext(build_ext):
if feature.freetype_version == 20: if feature.freetype_version == 20:
defs.append(("USE_FREETYPE_2_0", None)) defs.append(("USE_FREETYPE_2_0", None))
exts.append(Extension( exts.append(Extension(
"_imagingft", ["_imagingft.c"], libraries=["freetype"], "PIL._imagingft", ["_imagingft.c"], libraries=["freetype"],
define_macros=defs)) define_macros=defs))
if os.path.isfile("_imagingtiff.c") and feature.tiff: if os.path.isfile("_imagingtiff.c") and feature.tiff:
exts.append(Extension( exts.append(Extension(
"_imagingtiff", ["_imagingtiff.c"], libraries=["tiff"])) "PIL._imagingtiff", ["_imagingtiff.c"], libraries=["tiff"]))
if os.path.isfile("_imagingcms.c") and feature.lcms: if os.path.isfile("_imagingcms.c") and feature.lcms:
extra = [] extra = []
if sys.platform == "win32": if sys.platform == "win32":
extra.extend(["user32", "gdi32"]) extra.extend(["user32", "gdi32"])
exts.append(Extension( exts.append(Extension(
"_imagingcms", ["_imagingcms.c"], libraries=["lcms"] + extra)) "PIL._imagingcms", ["_imagingcms.c"], libraries=["lcms"] + extra))
if os.path.isfile("_webp.c") and feature.webp: if os.path.isfile("_webp.c") and feature.webp:
exts.append(Extension( exts.append(Extension(
@ -351,16 +351,16 @@ class pil_build_ext(build_ext):
break break
if frameworks: if frameworks:
exts.append(Extension( exts.append(Extension(
"_imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"], "PIL._imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"],
extra_compile_args=frameworks, extra_link_args=frameworks)) extra_compile_args=frameworks, extra_link_args=frameworks))
feature.tcl = feature.tk = 1 # mark as present feature.tcl = feature.tk = 1 # mark as present
elif feature.tcl and feature.tk: elif feature.tcl and feature.tk:
exts.append(Extension( exts.append(Extension(
"_imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"], "PIL._imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"],
libraries=[feature.tcl, feature.tk])) libraries=[feature.tcl, feature.tk]))
if os.path.isfile("_imagingmath.c"): if os.path.isfile("_imagingmath.c"):
exts.append(Extension("_imagingmath", ["_imagingmath.c"])) exts.append(Extension("PIL._imagingmath", ["_imagingmath.c"]))
self.extensions[:] = exts self.extensions[:] = exts
@ -494,7 +494,7 @@ setup(
"Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.3",
], ],
cmdclass={"build_ext": pil_build_ext}, cmdclass={"build_ext": pil_build_ext},
ext_modules=[Extension("_imaging", ["_imaging.c"])], ext_modules=[Extension("PIL._imaging", ["_imaging.c"])],
packages=find_packages(), packages=find_packages(),
scripts=glob.glob("Scripts/pil*.py"), scripts=glob.glob("Scripts/pil*.py"),
keywords=["Imaging",], keywords=["Imaging",],