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 ...@@ -20,7 +20,6 @@ import sys
import getopt import getopt
from topydo.cli.CLIApplicationBase import MAIN_OPTS, error from topydo.cli.CLIApplicationBase import MAIN_OPTS, error
from topydo.cli.CLI import CLIApplication from topydo.cli.CLI import CLIApplication
from topydo.cli.Prompt import PromptApplication
def main(): def main():
""" Main entry point of the CLI. """ """ Main entry point of the CLI. """
...@@ -34,7 +33,11 @@ def main(): ...@@ -34,7 +33,11 @@ def main():
sys.exit(1) sys.exit(1)
if args[0] == 'prompt': if args[0] == 'prompt':
try:
from topydo.cli.Prompt import PromptApplication
PromptApplication().run() PromptApplication().run()
except ImportError:
error("You have to install prompt-toolkit to run prompt mode.")
else: else:
CLIApplication().run() CLIApplication().run()
except IndexError: 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