# -*- coding: utf-8 -*-

import sys

import click

from indra.machine.utils import run_with_pmids_helper, run_with_search_helper, summarize_helper


@click.group()
def main():
    """The RAS Machine and utilities"""


@main.command()
@click.argument('model_path')
@click.option('--config', help='Specify configuration file path, otherwise '
                               'looks for config.yaml in model path')
def run_with_search(model_path, config):
    """Run with PubMed search for new papers."""
    run_with_search_helper(model_path, config)


@main.command()
@click.argument('model_path')
def summarize(model_path):
    """Print model summary."""
    summarize_helper(model_path)


@main.command()
@click.argument('model_path')
@click.option('--pmids', type=click.File(), default=sys.stdin,
              help="A file with a PMID on each line")
def run_with_pmids(model_path, pmids):
    """Run with given list of PMIDs."""
    run_with_pmids_helper(model_path, pmids)


if __name__ == '__main__':
    main()

@@ -48,105 +48,8 @@
 ck%0A%0A
-from indra.machine.utils import run_with_pmids_helper, run_with_search_helper, summarize_helper%0A%0A
 %0A@cl
@@ -66,18 +66,21 @@
 )%0Adef ma
+ch
 in
+e
 ():%0A    
@@ -116,26 +116,29 @@
 ies%22%22%22%0A%0A%0A@ma
+ch
 in
+e
 .command()%0A@
@@ -399,24 +399,83 @@
  papers.%22%22%22%0A
+    from indra.machine.utils import run_with_search_helper%0A
     run_with
@@ -510,26 +510,29 @@
 onfig)%0A%0A%0A@ma
+ch
 in
+e
 .command()%0A@
@@ -614,24 +614,77 @@
 summary.%22%22%22%0A
+    from indra.machine.utils import summarize_helper%0A
     summariz
@@ -709,18 +709,21 @@
 h)%0A%0A%0A@ma
+ch
 in
+e
 .command
@@ -947,24 +947,82 @@
 f PMIDs.%22%22%22%0A
+    from indra.machine.utils import run_with_pmids_helper%0A
     run_with
@@ -1089,13 +1089,16 @@
 :%0A    ma
+ch
 in
+e
 ()%0A

Rename main to machine