From 09b4d1b0c98fd34a7af886c80c6e17cd42217500 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 30 Sep 2019 04:14:09 +0300 Subject: Travis: online_sessions.sh: refactoring --- .travis/test/online_sessions.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis/test/online_sessions.sh b/.travis/test/online_sessions.sh index 0bf578c..b8a56de 100755 --- a/.travis/test/online_sessions.sh +++ b/.travis/test/online_sessions.sh @@ -9,6 +9,13 @@ set -o errexit -o nounset -o pipefail readonly db_path='.travis/test_db.csv' +fix_matplotlib() { + # Get rid of: + # tkinter.TclError: no display name and no $DISPLAY environment variable + mkdir -p -- ~/.config/matplotlib + echo 'backend: Agg' > ~/.config/matplotlib/matplotlibrc +} + _online_sessions() { local output_path output_path="$( mktemp --dry-run )" @@ -31,11 +38,6 @@ _online_sessions() { } online_sessions() { - # Get rid of: - # tkinter.TclError: no display name and no $DISPLAY environment variable - mkdir -p -- ~/.config/matplotlib - echo 'backend: Agg' > ~/.config/matplotlib/matplotlibrc - _online_sessions --group-by user --output-format csv _online_sessions --group-by user --output-format json @@ -46,6 +48,7 @@ online_sessions() { } main() { + fix_matplotlib online_sessions } -- cgit v1.2.3