Browse Source

Merge #658: Correct `import matplotlib` exception handling

ea855b3 Correct `import matplotlib` exception handling (Kristaps Kaupe)
master
Adam Gibson 5 years ago
parent
commit
7bf2ebb2ce
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 7
      scripts/obwatch/ob-watcher.py

7
scripts/obwatch/ob-watcher.py

@ -20,16 +20,17 @@ from twisted.internet import reactor
from jmbase.support import EXIT_FAILURE
# https://stackoverflow.com/questions/2801882/generating-a-png-with-matplotlib-when-display-is-undefined
try:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
except:
print("matplotlib not found; do `pip install matplotlib` "
"in the joinmarket virtualenv.")
sys.exit(EXIT_FAILURE)
# https://stackoverflow.com/questions/2801882/generating-a-png-with-matplotlib-when-display-is-undefined
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from jmbase import get_log
from jmclient import jm_single, load_program_config, calc_cj_fee, \
get_irc_mchannels, add_base_options

Loading…
Cancel
Save