Update matplotlibrc filtering for GUI backends
This commit is contained in:
parent
a388871083
commit
8a0824df09
2 changed files with 10 additions and 10 deletions
|
@ -80,19 +80,17 @@ def install(self, spec, prefix):
|
||||||
setup_py('build')
|
setup_py('build')
|
||||||
setup_py('install', '--prefix={0}'.format(prefix))
|
setup_py('install', '--prefix={0}'.format(prefix))
|
||||||
|
|
||||||
if str(self.version) in ['1.4.2', '1.4.3']:
|
if '+gui' in spec:
|
||||||
# hack to fix configuration file
|
# Set backend in matplotlib configuration file
|
||||||
config_file = None
|
config_file = None
|
||||||
for p, d, f in os.walk(prefix.lib):
|
for p, d, f in os.walk(prefix.lib):
|
||||||
for file in f:
|
for file in f:
|
||||||
if file.find('matplotlibrc') != -1:
|
if file.find('matplotlibrc') != -1:
|
||||||
config_file = join_path(p, 'matplotlibrc')
|
config_file = join_path(p, 'matplotlibrc')
|
||||||
print config_file
|
|
||||||
if not config_file:
|
if not config_file:
|
||||||
raise InstallError('could not find config file')
|
raise InstallError('Could not find matplotlibrc')
|
||||||
filter_file(r'backend : pyside',
|
|
||||||
'backend : Qt4Agg',
|
kwargs = {'ignore_absent': False, 'backup': False, 'string': False}
|
||||||
config_file)
|
rc = FileFilter(config_file)
|
||||||
filter_file(r'#backend.qt4 : PyQt4',
|
rc.filter('^backend.*', 'backend : Qt4Agg', **kwargs)
|
||||||
'backend.qt4 : PySide',
|
rc.filter('^#backend.qt4.*', 'backend.qt4 : PySide', **kwargs)
|
||||||
config_file)
|
|
||||||
|
|
|
@ -133,6 +133,8 @@ def install(self, spec, prefix):
|
||||||
# TODO: Once better testing support is integrated, add the following tests
|
# TODO: Once better testing support is integrated, add the following tests
|
||||||
# https://wiki.python.org/moin/TkInter
|
# https://wiki.python.org/moin/TkInter
|
||||||
#
|
#
|
||||||
|
# Note: Only works if ForwardX11Trusted is enabled, i.e. `ssh -Y`
|
||||||
|
#
|
||||||
# if '+tk' in spec:
|
# if '+tk' in spec:
|
||||||
# env['TK_LIBRARY'] = join_path(spec['tk'].prefix.lib,
|
# env['TK_LIBRARY'] = join_path(spec['tk'].prefix.lib,
|
||||||
# 'tk{0}'.format(spec['tk'].version.up_to(2)))
|
# 'tk{0}'.format(spec['tk'].version.up_to(2)))
|
||||||
|
|
Loading…
Reference in a new issue