Skip to content
Snippets Groups Projects
Commit d35f0894 authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Add script to configure matplotlib on server, no-interactive backend

parent d1b6e052
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ navipy_install: ...@@ -16,6 +16,7 @@ navipy_install:
- virtualenv -p python3 venv - virtualenv -p python3 venv
- source venv/bin/activate - source venv/bin/activate
- pip3 install . - pip3 install .
- python navipy/script/config_matplotlib_server.py # because no interactive backend
artifacts: artifacts:
paths: paths:
......
#!/usr/bin/env python3
import fileinput
import matplotlib
filename = matplotlib.matplotlib_fname()
print('In file: {}'.format(filename))
text_to_search = 'backend '
replacement_text = '#backend '
print('replace {} by {}'.format(text_to_search, replacement_text))
with fileinput.FileInput(filename, inplace=True, backup='.bak') as file:
for line in file:
print(line.replace(text_to_search, replacement_text), end='')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment