guetzli-recursively-gui/.eggs/py2app-0.12-py3.6.egg/py2app/recipes/matplotlib.py

28 lines
713 B
Python
Raw Normal View History

2017-04-20 00:57:59 +02:00
import os
def check(cmd, mf):
m = mf.findNode('matplotlib')
if m is None or m.filename is None:
return None
if cmd.matplotlib_backends:
backends = {}
for backend in cmd.matplotlib_backends:
if backend == '-':
pass
elif backend == '*':
mf.import_hook('matplotlib.backends', m, ['*'])
else:
mf.import_hook('matplotlib.backends.backend_%s'%(backend,), m)
else:
backends = {'packages': ['matplotlib']}
return dict(
prescripts=['py2app.recipes.matplotlib_prescript'],
resources=[os.path.join(os.path.dirname(m.filename), 'mpl-data')],
**backends
)