Example #1
0
def main_non_archive(args):
    # validation
    if not args.galaxy_root:
        raise ValueError(
                'in non-archive mode the galaxy root must be specified')
    if not args.tools_subdir:
        raise ValueError(
                'in non-archive mode the tools subdirectory must be specified')
    # get the module names
    module_names = meta.get_module_names(
            args.manifest, args.create_all, args.create_tagged)
    # create the python subtree
    tools_subdir_path = os.path.join(
            args.galaxy_root, 'tools', args.tools_subdir)
    meta.add_python_files(module_names, tools_subdir_path)
    shutil.copyfile('galaxy_format_tweak.py',
            os.path.join(tools_subdir_path, 'galaxy_format_tweak.py'))
    # create the galaxy xml interface files
    xml_filenames, import_errors = add_xml_files(args.galaxy_root,
            module_names, args.short_length, args.tools_subdir)
    for e in import_errors:
        print e
    # create the toolbox xml pointing to the installed xmls
    toolbox_pathname = os.path.join(args.galaxy_root, args.tool_conf)
    section_name = args.tools_subdir
    section_id = args.tools_subdir
    toolbox_xml = get_toolbox_xml(section_name, section_id,
            args.tools_subdir, xml_filenames)
    with open(toolbox_pathname, 'wt') as fout:
        fout.write(toolbox_xml)
Example #2
0
def main_non_archive(args):
    # validation
    if not args.galaxy_root:
        raise ValueError(
            'in non-archive mode the galaxy root must be specified')
    if not args.tools_subdir:
        raise ValueError(
            'in non-archive mode the tools subdirectory must be specified')
    # get the module names
    module_names = meta.get_module_names(args.manifest, args.create_all,
                                         args.create_tagged)
    # create the python subtree
    tools_subdir_path = os.path.join(args.galaxy_root, 'tools',
                                     args.tools_subdir)
    meta.add_python_files(module_names, tools_subdir_path)
    shutil.copyfile('galaxy_format_tweak.py',
                    os.path.join(tools_subdir_path, 'galaxy_format_tweak.py'))
    # create the galaxy xml interface files
    xml_filenames, import_errors = add_xml_files(args.galaxy_root,
                                                 module_names,
                                                 args.short_length,
                                                 args.tools_subdir)
    for e in import_errors:
        print e
    # create the toolbox xml pointing to the installed xmls
    toolbox_pathname = os.path.join(args.galaxy_root, args.tool_conf)
    section_name = args.tools_subdir
    section_id = args.tools_subdir
    toolbox_xml = get_toolbox_xml(section_name, section_id, args.tools_subdir,
                                  xml_filenames)
    with open(toolbox_pathname, 'wt') as fout:
        fout.write(toolbox_xml)
Example #3
0
def main(args):
    module_names = meta.get_module_names(
            args.manifest, args.create_all, args.create_tagged)
    module_deps, const_deps = meta.get_module_and_const_deps(module_names)
    print 'module deps:'
    for module_dep in module_deps:
        print module_dep
    print
    print 'const deps:'
    for const_dep in const_deps:
        print const_dep
Example #4
0
def main(args):
    module_names = meta.get_module_names(args.manifest, args.create_all,
                                         args.create_tagged)
    module_deps, const_deps = meta.get_module_and_const_deps(module_names)
    print 'module deps:'
    for module_dep in module_deps:
        print module_dep
    print
    print 'const deps:'
    for const_dep in const_deps:
        print const_dep
Example #5
0
def main_archive(args):
    # validation
    if args.galaxy_root:
        raise ValueError(
            'in archive mode the galaxy root must not be specified')
    if args.tools_subdir:
        raise ValueError(
            'in archive mode the tools subdirectory must not be specified')
    # define the archive extension and the compression command
    archive_extension = '.tar.bz2'
    archive_prefix = os.path.basename(args.suite_archive.rstrip('/'))
    archive_name = archive_prefix + archive_extension
    archive_cmd = ['tar', 'cjvf', archive_name, args.suite_archive]
    # delete the suite directory and archive if they exist
    try:
        shutil.rmtree(args.suite_archive)
        os.remove(archive_name)
    except OSError as e:
        pass
    # get the module names
    module_names = meta.get_module_names(args.manifest, args.create_all,
                                         args.create_tagged)
    # create the empty suite directory
    os.makedirs(args.suite_archive)
    # add the python files
    meta.add_python_files(module_names, args.suite_archive)
    shutil.copyfile('galaxy_format_tweak.py',
                    os.path.join(args.suite_archive, 'galaxy_format_tweak.py'))
    # create the galaxy xml interface files
    mod_infos, import_errors = add_xml_archive_files(module_names,
                                                     args.short_length,
                                                     args.suite_archive)
    for e in import_errors:
        print e
    # create the toolbox xml pointing to the installed xmls
    config_pathname = os.path.join(args.suite_archive, 'suite_config.xml')
    config_xml = get_suite_config_xml(mod_infos, archive_prefix)
    with open(config_pathname, 'wt') as fout:
        fout.write(config_xml)
    # use subprocess instead of tarfile to create the tgz
    subprocess.call(archive_cmd)
Example #6
0
def main_archive(args):
    # validation
    if args.galaxy_root:
        raise ValueError(
                'in archive mode the galaxy root must not be specified')
    if args.tools_subdir:
        raise ValueError(
                'in archive mode the tools subdirectory must not be specified')
    # define the archive extension and the compression command
    archive_extension = '.tar.bz2'
    archive_prefix = os.path.basename(args.suite_archive.rstrip('/'))
    archive_name = archive_prefix + archive_extension
    archive_cmd = ['tar', 'cjvf', archive_name, args.suite_archive]
    # delete the suite directory and archive if they exist
    try:
        shutil.rmtree(args.suite_archive)
        os.remove(archive_name)
    except OSError as e:
        pass
    # get the module names
    module_names = meta.get_module_names(
            args.manifest, args.create_all, args.create_tagged)
    # create the empty suite directory
    os.makedirs(args.suite_archive)
    # add the python files
    meta.add_python_files(module_names, args.suite_archive)
    shutil.copyfile('galaxy_format_tweak.py',
            os.path.join(args.suite_archive, 'galaxy_format_tweak.py'))
    # create the galaxy xml interface files
    mod_infos, import_errors = add_xml_archive_files(
            module_names, args.short_length, args.suite_archive)
    for e in import_errors:
        print e
    # create the toolbox xml pointing to the installed xmls
    config_pathname = os.path.join(args.suite_archive, 'suite_config.xml')
    config_xml = get_suite_config_xml(mod_infos, archive_prefix)
    with open(config_pathname, 'wt') as fout:
        fout.write(config_xml)
    # use subprocess instead of tarfile to create the tgz
    subprocess.call(archive_cmd)
Example #7
0
def main(args):
    # check for flag conflicts
    if args.deploy and args.make_installer:
        raise ValueError(
            'the "deploy" and "make_installer" flags are incompatible')
    # initialize the mobyle category information
    cat_info = mobyle.CategoryInfo(args.show_io_types, args.show_tags,
                                   args.universal_category)
    # get the module names
    module_names = meta.get_module_names(args.manifest, args.create_all,
                                         args.create_tagged)
    # define the environment on the target server
    auto_path = os.path.join(args.target, 'auto.py')
    env_info = mobenv.create_environment_info(auto_path, args.python_path,
                                              args.mobyle_core,
                                              args.mobyle_version)
    if args.make_installer:
        create_installer(args, cat_info, env_info, module_names)
    else:
        # create the python subtree
        meta.add_python_files(module_names, args.target)
        # create the mobyle xml interface files
        import_errors = mobyle.add_xml_files(cat_info, env_info, module_names,
                                             args.short_length,
                                             env_info.get_xml_dir(),
                                             args.runbsub)
        for e in import_errors:
            print e
    if args.clean:
        cmd = env_info.get_clean_command()
        subprocess.call(cmd)
    if args.index:
        cmd = env_info.get_index_command()
        subprocess.call(cmd)
    if args.deploy:
        cmd = env_info.get_deploy_command()
        subprocess.call(cmd)
Example #8
0
def main(args):
    # check for flag conflicts
    if args.deploy and args.make_installer:
        raise ValueError(
                'the "deploy" and "make_installer" flags are incompatible')
    # initialize the mobyle category information
    cat_info = mobyle.CategoryInfo(
            args.show_io_types, args.show_tags, args.universal_category)
    # get the module names
    module_names = meta.get_module_names(
            args.manifest, args.create_all, args.create_tagged)
    # define the environment on the target server
    auto_path = os.path.join(args.target, 'auto.py')
    env_info = mobenv.create_environment_info(
            auto_path, args.python_path,
            args.mobyle_core, args.mobyle_version)
    if args.make_installer:
        create_installer(args, cat_info, env_info, module_names)
    else:
        # create the python subtree
        meta.add_python_files(module_names, args.target)
        # create the mobyle xml interface files
        import_errors = mobyle.add_xml_files(
                cat_info, env_info,
                module_names, args.short_length, env_info.get_xml_dir(),
                args.runbsub)
        for e in import_errors:
            print e
    if args.clean:
        cmd = env_info.get_clean_command()
        subprocess.call(cmd)
    if args.index:
        cmd = env_info.get_index_command()
        subprocess.call(cmd)
    if args.deploy:
        cmd = env_info.get_deploy_command()
        subprocess.call(cmd)