Skip to content

Commit

Permalink
Only enable --gui if Gooey is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
durden committed Oct 23, 2018
1 parent c70db67 commit c64805f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pywc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def gui():
the GUI as an option.
"""

if None in (Gooey, IGNORE_COMMAND):
raise EnvironmentError('Requires Gooey library')

# This is a perfect setup for functools.partial, but Gooey wants a real
# function not a partial object
def cli_only():
Expand Down Expand Up @@ -62,7 +65,7 @@ def cli(allow_gui_option=True):
'-l', dest='count_lines', action='store_true', default=False,
help='Show number of lines in file(s)')

if allow_gui_option:
if allow_gui_option and Gooey and IGNORE_COMMAND:
parser.add_argument(
'--gui', dest='use_gui', action='store_true', default=False,
help='Use GUI to run application')
Expand Down

0 comments on commit c64805f

Please sign in to comment.