From 8b7cfac2dea5c92efaee14f1df4a5317232897c3 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Wed, 16 Apr 2014 09:33:07 +0200 Subject: [PATCH] Added an new command to the CLI, implementation will follow. --- fourmi.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/fourmi.py b/fourmi.py index d8bc427..dcd15f0 100755 --- a/fourmi.py +++ b/fourmi.py @@ -5,6 +5,7 @@ Fourmi, an web scraper build to search specific information for a given compound Usage: fourmi search fourmi [options] search + fourmi list fourmi -h | --help fourmi --version @@ -84,11 +85,18 @@ def start_log(arguments): else: log.start(logstdout=True, loglevel=log.WARNING) - -if __name__ == '__main__': - arguments = docopt.docopt(__doc__, version='Fourmi - V0.1.0') +def search(arguments): start_log(arguments) settings = scrapy_settings_manipulation(arguments) setup_crawler([arguments[""]], settings) reactor.run() + +if __name__ == '__main__': + arguments = docopt.docopt(__doc__, version='Fourmi - V0.1.0') + print arguments + + if arguments["search"]: + search(arguments) + elif arguments["list"]: + load_parsers() #[todo] - this should just show the different sources. \ No newline at end of file