Skip to content
Snippets Groups Projects
Commit 8a0824df authored by Adam J. Stewart's avatar Adam J. Stewart
Browse files

Update matplotlibrc filtering for GUI backends

parent a3888710
Branches
Tags
No related merge requests found
......@@ -80,19 +80,17 @@ def install(self, spec, prefix):
setup_py('build')
setup_py('install', '--prefix={0}'.format(prefix))
if str(self.version) in ['1.4.2', '1.4.3']:
# hack to fix configuration file
if '+gui' in spec:
# Set backend in matplotlib configuration file
config_file = None
for p, d, f in os.walk(prefix.lib):
for file in f:
if file.find('matplotlibrc') != -1:
config_file = join_path(p, 'matplotlibrc')
print config_file
if not config_file:
raise InstallError('could not find config file')
filter_file(r'backend : pyside',
'backend : Qt4Agg',
config_file)
filter_file(r'#backend.qt4 : PyQt4',
'backend.qt4 : PySide',
config_file)
raise InstallError('Could not find matplotlibrc')
kwargs = {'ignore_absent': False, 'backup': False, 'string': False}
rc = FileFilter(config_file)
rc.filter('^backend.*', 'backend : Qt4Agg', **kwargs)
rc.filter('^#backend.qt4.*', 'backend.qt4 : PySide', **kwargs)
......@@ -133,6 +133,8 @@ def install(self, spec, prefix):
# TODO: Once better testing support is integrated, add the following tests
# https://wiki.python.org/moin/TkInter
#
# Note: Only works if ForwardX11Trusted is enabled, i.e. `ssh -Y`
#
# if '+tk' in spec:
# env['TK_LIBRARY'] = join_path(spec['tk'].prefix.lib,
# 'tk{0}'.format(spec['tk'].version.up_to(2)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment