Update icon and Add info
This commit is contained in:
87
.eggs/py2app-0.12-py3.6.egg/py2app/recipes/PIL/__init__.py
Normal file
87
.eggs/py2app-0.12-py3.6.egg/py2app/recipes/PIL/__init__.py
Normal file
@ -0,0 +1,87 @@
|
||||
from py2app.util import imp_find_module
|
||||
import os, sys, glob
|
||||
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
try:
|
||||
set
|
||||
except NameError:
|
||||
from sets import Set as set
|
||||
|
||||
try:
|
||||
basestring
|
||||
except NameError:
|
||||
basestring = str
|
||||
|
||||
|
||||
def check(cmd, mf):
|
||||
m = mf.findNode('Image') or mf.findNode('PIL.Image')
|
||||
if m is None or m.filename is None:
|
||||
return None
|
||||
|
||||
if mf.findNode('PIL.Image'):
|
||||
have_PIL = True
|
||||
else:
|
||||
have_PIL = False
|
||||
|
||||
plugins = set()
|
||||
visited = set()
|
||||
for folder in sys.path:
|
||||
if not isinstance(folder, basestring):
|
||||
continue
|
||||
|
||||
for extra in ('', 'PIL'):
|
||||
folder = os.path.realpath(os.path.join(folder, extra))
|
||||
if (not os.path.isdir(folder)) or (folder in visited):
|
||||
continue
|
||||
for fn in os.listdir(folder):
|
||||
if not fn.endswith('ImagePlugin.py'):
|
||||
continue
|
||||
|
||||
mod, ext = os.path.splitext(fn)
|
||||
try:
|
||||
sys.path.insert(0, folder)
|
||||
imp_find_module(mod)
|
||||
del sys.path[0]
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
plugins.add(mod)
|
||||
visited.add(folder)
|
||||
s = StringIO('_recipes_pil_prescript(%r)\n' % list(plugins))
|
||||
for plugin in plugins:
|
||||
if have_PIL:
|
||||
mf.implyNodeReference(m, 'PIL.' + plugin)
|
||||
else:
|
||||
mf.implyNodeReference(m, plugin)
|
||||
|
||||
mf.removeReference(m, 'FixTk')
|
||||
# Since Imaging-1.1.5, SpiderImagePlugin imports ImageTk conditionally.
|
||||
# This is not ever used unless the user is explicitly using Tk elsewhere.
|
||||
sip = mf.findNode('SpiderImagePlugin')
|
||||
if sip is not None:
|
||||
mf.removeReference(sip, 'ImageTk')
|
||||
|
||||
# The ImageQt plugin should only be usefull when using PyQt, which
|
||||
# would then be explicitly imported.
|
||||
# Note: this code doesn't have the right side-effect at the moment
|
||||
# due to the way the PyQt5 recipe is structured.
|
||||
sip = mf.findNode('PIL.ImageQt')
|
||||
if sip is not None:
|
||||
mf.removeReference(sip, 'PyQt5')
|
||||
mf.removeReference(sip, 'PyQt5.QtGui')
|
||||
mf.removeReference(sip, 'PyQt5.QtCore')
|
||||
|
||||
mf.removeReference(sip, 'PyQt4')
|
||||
mf.removeReference(sip, 'PyQt4.QtGui')
|
||||
mf.removeReference(sip, 'PyQt4.QtCore')
|
||||
pass
|
||||
|
||||
return dict(
|
||||
prescripts = ['py2app.recipes.PIL.prescript', s],
|
||||
include = "PIL.JpegPresets", # Dodgy import from PIL.JpegPlugin in Pillow 2.0
|
||||
flatpackages = [os.path.dirname(m.filename)],
|
||||
)
|
43
.eggs/py2app-0.12-py3.6.egg/py2app/recipes/PIL/prescript.py
Normal file
43
.eggs/py2app-0.12-py3.6.egg/py2app/recipes/PIL/prescript.py
Normal file
@ -0,0 +1,43 @@
|
||||
def _recipes_pil_prescript(plugins):
|
||||
try:
|
||||
import Image
|
||||
have_PIL = False
|
||||
except ImportError:
|
||||
from PIL import Image
|
||||
have_PIL = True
|
||||
|
||||
import sys
|
||||
def init():
|
||||
if Image._initialized >= 2:
|
||||
return
|
||||
|
||||
if have_PIL:
|
||||
try:
|
||||
import PIL.JpegPresets
|
||||
sys.modules['JpegPresets'] = PIL.JpegPresets
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
for plugin in plugins:
|
||||
try:
|
||||
if have_PIL:
|
||||
try:
|
||||
# First try absolute import through PIL (for Pillow support)
|
||||
# only then try relative imports
|
||||
m = __import__('PIL.' + plugin, globals(), locals(), [])
|
||||
m = getattr(m, plugin)
|
||||
sys.modules[plugin] = m
|
||||
continue
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
__import__(plugin, globals(), locals(), [])
|
||||
except ImportError:
|
||||
if Image.DEBUG:
|
||||
print('Image: failed to import')
|
||||
|
||||
if Image.OPEN or Image.SAVE:
|
||||
Image._initialized = 2
|
||||
return 1
|
||||
|
||||
Image.init = init
|
Reference in New Issue
Block a user