Exemplo n.º 1
0
def importer(*params):
    parser = ArgumentParser("Imports old descriptor or BIDS app or CWL"
                            " descriptor to spec.")
    parser.add_argument("type", help="Type of import we are performing",
                        choices=["bids", "0.4", "cwl", "dcpt"])
    parser.add_argument("output_descriptor", help="Where the Boutiques"
                        " descriptor will be written.")
    parser.add_argument("input_descriptor", help="Input descriptor to be"
                        " converted. For '0.4', is JSON descriptor,"
                        " for 'dcpt' is JSON descriptor,"
                        " for 'bids' is base directory of BIDS app,"
                        " for 'cwl' is YAML descriptor.")
    parser.add_argument("-o", "--output-invocation", help="Where to write "
                        "the invocation if any.")
    parser.add_argument("-i", "--input-invocation", help="Input invocation "
                        " for CWL if any.")
    results = parser.parse_args(params)

    from boutiques.importer import Importer
    importer = Importer(results.input_descriptor,
                        results.output_descriptor,
                        results.input_invocation,
                        results.output_invocation)
    if results.type == "0.4":
        importer.upgrade_04()
    elif results.type == "bids":
        importer.import_bids()
    elif results.type == "cwl":
        importer.import_cwl()
    elif results.type == "dcpt":
        create(params[1])
        importer.import_docopt(params[1])
Exemplo n.º 2
0
def importer(*params):
    parser = parser_importer()
    results = parser.parse_args(params)

    from boutiques.importer import Importer
    importer = Importer(results.input_descriptor, results.output_descriptor,
                        results.input_invocation, results.output_invocation)
    if results.type == "0.4":
        importer.upgrade_04()
    elif results.type == "bids":
        importer.import_bids()
    elif results.type == "cwl":
        importer.import_cwl()
    elif results.type == "docopt":
        create(params[1])
        importer.import_docopt(params[1])
Exemplo n.º 3
0
def importer(*params):
    parser = ArgumentParser("Imports old descriptor or BIDS app to spec.")
    parser.add_argument("type",
                        help="Type of import we are performing",
                        choices=["bids", "0.4"])
    parser.add_argument("descriptor",
                        help="Where the Boutiques descriptor will be written.")
    parser.add_argument(
        "input",
        help="Input to be convered. For '0.4', is JSON descriptor,"
        " for 'bids' is base directory of BIDS app.")
    results = parser.parse_args(params)

    descriptor = results.descriptor
    inp = results.input
    from boutiques.importer import Importer
    importer = Importer(descriptor)
    if results.type == "0.4":
        importer.upgrade_04(inp)
    elif results.type == "bids":
        importer.import_bids(inp)