Commit 4a7e8aed authored by Bram Schoenmakers's avatar Bram Schoenmakers

Merge pull request #36 from mruwek/fix-35

Import prompt-toolkit only if it's needed.
parents 51bf164f d651635f
......@@ -20,7 +20,6 @@ import sys
import getopt
from topydo.cli.CLIApplicationBase import MAIN_OPTS, error
from topydo.cli.CLI import CLIApplication
from topydo.cli.Prompt import PromptApplication
def main():
""" Main entry point of the CLI. """
......@@ -34,7 +33,11 @@ def main():
sys.exit(1)
if args[0] == 'prompt':
PromptApplication().run()
try:
from topydo.cli.Prompt import PromptApplication
PromptApplication().run()
except ImportError:
error("You have to install prompt-toolkit to run prompt mode.")
else:
CLIApplication().run()
except IndexError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment