Skip to content

Commit

Permalink
Load matplotlib backend in help
Browse files Browse the repository at this point in the history
This helps prevent a number of issues where some misconfigured backend
(Qt, Mac) is loaded and causes errors.
  • Loading branch information
Zaharid committed Sep 22, 2017
1 parent 6798d2d commit 4408d64
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/reportengine/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ def __init__(self,
def __call__(self, parser, namespace, values, option_string=None):
if not values:
parser.print_help()
elif values=='config':
parser.exit()
return

#Need to initialize the matplotlib babkend before printing
#help to avoid pulling QT and such when pyplot is imported anyewhere.
self.app.init_style({})
if values=='config':
print(helputils.format_config(self.app.config_class))
print("\n")
print(helputils.format_environment(self.app.environment_class))
Expand Down

0 comments on commit 4408d64

Please sign in to comment.