2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/39d18e79e314/ Changeset: 39d18e79e314 Branch: tool-shed-api User: BjoernGruening Date: 2013-04-06 20:54:40 Summary: merge install_repository_tool* scripts into one with a commandline interface Affected #: 4 files diff -r cb25513c63cd7aa2ebd472e91109c96276ed6d9d -r 39d18e79e314680ddd61a4dcf05769d03982abd0 scripts/api/install_repository_tools.py --- /dev/null +++ b/scripts/api/install_repository_tools.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +""" +Install a specified repository revision from a specified tool shed into Galaxy. This example demonstrates installation of a repository that contains +valid tools, loading them into a section of the Galaxy tool panel or creating a new tool panel section. +You can choose if tool dependencies or repository dependencies should be installed, use --repository-deps or --tool-deps. + +This example requires a tool panel config file (e.g., tool_conf.xml, shed_tool_conf.xml, etc) to contain a tool panel section like the following: + +<section id="from_test_tool_shed" name="From Test Tool Shed" version=""> +</section> + +Here is a working example of how to use this script to install a repository from the test tool shed. +./install_repository_tools.py -- api <api key> --local <galaxy base url> --url http://testtoolshed.g2.bx.psu.edu --name gregs_filter --owner greg --revision f28d5018f9cb --tool-deps +""" + +import os +import sys +import argparse +sys.path.insert( 0, os.path.dirname( __file__ ) ) +from common import submit + + +def main( options ): + """ + collect all user data and install the tools via the Galaxy API + """ + data = {} + data[ 'tool_shed_url' ] = options.tool_shed_url + data[ 'name' ] = options.name + data[ 'owner' ] = options.owner + data[ 'changeset_revision' ] = options.changeset_revision + if options.tool_panel_section_id: + data[ 'tool_panel_section_id' ] = options.tool_panel_section_id + elif options.new_tool_panel_section_label: + data['new_tool_panel_section_label'] = options.new_tool_panel_section_label + if options.install_repository_dependencies: + data[ 'install_repository_dependencies' ] = options.install_repository_dependencies + if options.install_tool_dependencies: + data[ 'install_tool_dependencies' ] = options.install_tool_dependencies + + submit( options.api, '%s%s' % (options.local_url, '/api/tool_shed_repositories/new/install_repository_revision'), data ) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Installation of tools via the Galaxy API.') + + parser.add_argument("-u", "--url", dest="tool_shed_url", + required=True, + help="Tool Shed URL") + + parser.add_argument("-a", "--api", dest="api", + required=True, + help="API Key") + + parser.add_argument("-l", "--local", dest="local_url", + required=True, + help="URL of the galaxy instance.") + + parser.add_argument("-n", "--name", + required=True, + help="Repository name.") + + parser.add_argument("-o", "--owner", + required=True, + help="Repository owner.") + + parser.add_argument("-r", "--revision", dest="changeset_revision", + required=True, + help="Repository owner.") + + parser.add_argument("--panel-section-id", dest="tool_panel_section_id", + help="Tool panel section id if you want to add your repo to an existing tool section.") + + parser.add_argument("--panel-section-name", dest="new_tool_panel_section_label", + help="New tool panel section label. If specified a new tool section will be created.") + + parser.add_argument("--repository-deps", dest="install_repository_dependencies", action="store_true", + default=False, + help="Install repository dependencies. [False]") + + parser.add_argument("--tool-deps", dest="install_tool_dependencies", action="store_true", + default=False, + help="Install tool dependencies. [False]") + + + options = parser.parse_args() + main( options ) + + + + + + + diff -r cb25513c63cd7aa2ebd472e91109c96276ed6d9d -r 39d18e79e314680ddd61a4dcf05769d03982abd0 scripts/api/install_repository_tools_into_existing_tool_panel_section.py --- a/scripts/api/install_repository_tools_into_existing_tool_panel_section.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -""" -Install a specified repository revision from a specified tool shed into Galaxy. This example demonstrates installation of a repository that contains -valid tools, loading them into an existing section of the Galaxy tool panel. The repository has no tool dependencies or repository dependencies, so only -a single repository will be installed. - -This example requires a tool panel config file (e.g., tool_conf.xml, shed_tool_conf.xml, etc) to contain a tool panel section like the following: - -<section id="from_test_tool_shed" name="From Test Tool Shed" version=""> -</section> - -usage: ./install_repository_tools_into_existing_tool_panel_section.py <api_key <galaxy base url> tool_shed_url name owner changeset_revision tool_panel_section_id - -Here is a working example of how to use this script to install a repository from the test tool shed. -./install_repository_tools_into_existing_tool_panel_section.py <api key><galaxy base url>/api/tool_shed_repositories/new/install_repository_revision http://testtoolshed.g2.bx.psu.edu gregs_filter greg f28d5018f9cb from_test_tool_shed -""" - -import os -import sys -sys.path.insert( 0, os.path.dirname( __file__ ) ) -from common import submit - -try: - assert sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision tool_panel_section_id' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -try: - data = {} - data[ 'tool_shed_url' ] = sys.argv[ 3 ] - data[ 'name' ] = sys.argv[ 4 ] - data[ 'owner' ] = sys.argv[ 5 ] - data[ 'changeset_revision' ] = sys.argv[ 6 ] - data[ 'tool_panel_section_id' ] = sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision tool_panel_section_id' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -submit( sys.argv[ 1 ], sys.argv[ 2 ], data ) diff -r cb25513c63cd7aa2ebd472e91109c96276ed6d9d -r 39d18e79e314680ddd61a4dcf05769d03982abd0 scripts/api/install_repository_tools_into_new_tool_panel_section.py --- a/scripts/api/install_repository_tools_into_new_tool_panel_section.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -""" -Install a specified repository revision from a specified tool shed into Galaxy. This example demonstrates installation of a repository that contains -valid tools, loading them into a new section of the Galaxy tool panel. The repository has no tool dependencies or repository dependencies, so only -a single repository will be installed. - -usage: ./install_repository_tools_into_new_tool_panel_section.py <api_key <galaxy base url> tool_shed_url name owner changeset_revision new_tool_panel_section_label - -Here is a working example of how to use this script to install a repository from the test tool shed. -./install_repository_tools_into_new_tool_panel_section.py <api key><galaxy base url>/api/tool_shed_repositories/new/install_repository_revision http://testtoolshed.g2.bx.psu.edu gregs_filter greg f28d5018f9cb 'From Test Tool Shed' -""" - -import os -import sys -sys.path.insert( 0, os.path.dirname( __file__ ) ) -from common import submit - -try: - assert sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision tool_panel_section_id' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -try: - data = {} - data[ 'tool_shed_url' ] = sys.argv[ 3 ] - data[ 'name' ] = sys.argv[ 4 ] - data[ 'owner' ] = sys.argv[ 5 ] - data[ 'changeset_revision' ] = sys.argv[ 6 ] - data[ 'new_tool_panel_section_label' ] = sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision new_tool_panel_section_label' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -submit( sys.argv[ 1 ], sys.argv[ 2 ], data ) diff -r cb25513c63cd7aa2ebd472e91109c96276ed6d9d -r 39d18e79e314680ddd61a4dcf05769d03982abd0 scripts/api/install_repository_with_repository_dependencies.py --- a/scripts/api/install_repository_with_repository_dependencies.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -""" -Install a specified repository revision from a specified tool shed into Galaxy. This example demonstrates installation of a repository that has -repository dependencies, so multiple repositories will ultimately be installed. Since no Galaxy tool panel section information is used, all tools -contained in the installed repositories will be loaded into the Galaxy tool panel outside of any sections. - -usage: ./install_repository_with_repository_dependencies.py <api_key <galaxy base url> tool_shed_url name owner changeset_revision True - -Here is a working example of how to use this script to install a repository from the test tool shed. -./install_repository_with_repository_dependencies.py <api key><galaxy base url>/api/tool_shed_repositories/new/install_repository_revision http://testtoolshed.g2.bx.psu.edu emboss_5 devteam 8ddad0c9a75a True -""" - -import os -import sys -sys.path.insert( 0, os.path.dirname( __file__ ) ) -from common import submit - -try: - assert sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision install_repository_dependencies' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -try: - data = {} - data[ 'tool_shed_url' ] = sys.argv[ 3 ] - data[ 'name' ] = sys.argv[ 4 ] - data[ 'owner' ] = sys.argv[ 5 ] - data[ 'changeset_revision' ] = sys.argv[ 6 ] - data[ 'install_repository_dependencies' ] = sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision install_repository_dependencies' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -submit( sys.argv[ 1 ], sys.argv[ 2 ], data ) https://bitbucket.org/galaxy/galaxy-central/commits/e54bbcffc6d7/ Changeset: e54bbcffc6d7 User: greg Date: 2013-04-16 16:19:17 Summary: Merged in BjoernGruening/galaxy-central-bgruening/tool-shed-api (pull request #153) merge install_repository_tool* scripts into one with a commandline interface Affected #: 4 files diff -r 7985a6d894359c8431e1a9a3a867edc8ff3aefc5 -r e54bbcffc6d7b6918b4a65e6855460e235b44b83 scripts/api/install_repository_tools.py --- /dev/null +++ b/scripts/api/install_repository_tools.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +""" +Install a specified repository revision from a specified tool shed into Galaxy. This example demonstrates installation of a repository that contains +valid tools, loading them into a section of the Galaxy tool panel or creating a new tool panel section. +You can choose if tool dependencies or repository dependencies should be installed, use --repository-deps or --tool-deps. + +This example requires a tool panel config file (e.g., tool_conf.xml, shed_tool_conf.xml, etc) to contain a tool panel section like the following: + +<section id="from_test_tool_shed" name="From Test Tool Shed" version=""> +</section> + +Here is a working example of how to use this script to install a repository from the test tool shed. +./install_repository_tools.py -- api <api key> --local <galaxy base url> --url http://testtoolshed.g2.bx.psu.edu --name gregs_filter --owner greg --revision f28d5018f9cb --tool-deps +""" + +import os +import sys +import argparse +sys.path.insert( 0, os.path.dirname( __file__ ) ) +from common import submit + + +def main( options ): + """ + collect all user data and install the tools via the Galaxy API + """ + data = {} + data[ 'tool_shed_url' ] = options.tool_shed_url + data[ 'name' ] = options.name + data[ 'owner' ] = options.owner + data[ 'changeset_revision' ] = options.changeset_revision + if options.tool_panel_section_id: + data[ 'tool_panel_section_id' ] = options.tool_panel_section_id + elif options.new_tool_panel_section_label: + data['new_tool_panel_section_label'] = options.new_tool_panel_section_label + if options.install_repository_dependencies: + data[ 'install_repository_dependencies' ] = options.install_repository_dependencies + if options.install_tool_dependencies: + data[ 'install_tool_dependencies' ] = options.install_tool_dependencies + + submit( options.api, '%s%s' % (options.local_url, '/api/tool_shed_repositories/new/install_repository_revision'), data ) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Installation of tools via the Galaxy API.') + + parser.add_argument("-u", "--url", dest="tool_shed_url", + required=True, + help="Tool Shed URL") + + parser.add_argument("-a", "--api", dest="api", + required=True, + help="API Key") + + parser.add_argument("-l", "--local", dest="local_url", + required=True, + help="URL of the galaxy instance.") + + parser.add_argument("-n", "--name", + required=True, + help="Repository name.") + + parser.add_argument("-o", "--owner", + required=True, + help="Repository owner.") + + parser.add_argument("-r", "--revision", dest="changeset_revision", + required=True, + help="Repository owner.") + + parser.add_argument("--panel-section-id", dest="tool_panel_section_id", + help="Tool panel section id if you want to add your repo to an existing tool section.") + + parser.add_argument("--panel-section-name", dest="new_tool_panel_section_label", + help="New tool panel section label. If specified a new tool section will be created.") + + parser.add_argument("--repository-deps", dest="install_repository_dependencies", action="store_true", + default=False, + help="Install repository dependencies. [False]") + + parser.add_argument("--tool-deps", dest="install_tool_dependencies", action="store_true", + default=False, + help="Install tool dependencies. [False]") + + + options = parser.parse_args() + main( options ) + + + + + + + diff -r 7985a6d894359c8431e1a9a3a867edc8ff3aefc5 -r e54bbcffc6d7b6918b4a65e6855460e235b44b83 scripts/api/install_repository_tools_into_existing_tool_panel_section.py --- a/scripts/api/install_repository_tools_into_existing_tool_panel_section.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -""" -Install a specified repository revision from a specified tool shed into Galaxy. This example demonstrates installation of a repository that contains -valid tools, loading them into an existing section of the Galaxy tool panel. The repository has no tool dependencies or repository dependencies, so only -a single repository will be installed. - -This example requires a tool panel config file (e.g., tool_conf.xml, shed_tool_conf.xml, etc) to contain a tool panel section like the following: - -<section id="from_test_tool_shed" name="From Test Tool Shed" version=""> -</section> - -usage: ./install_repository_tools_into_existing_tool_panel_section.py <api_key <galaxy base url> tool_shed_url name owner changeset_revision tool_panel_section_id - -Here is a working example of how to use this script to install a repository from the test tool shed. -./install_repository_tools_into_existing_tool_panel_section.py <api key><galaxy base url>/api/tool_shed_repositories/new/install_repository_revision http://testtoolshed.g2.bx.psu.edu gregs_filter greg f28d5018f9cb from_test_tool_shed -""" - -import os -import sys -sys.path.insert( 0, os.path.dirname( __file__ ) ) -from common import submit - -try: - assert sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision tool_panel_section_id' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -try: - data = {} - data[ 'tool_shed_url' ] = sys.argv[ 3 ] - data[ 'name' ] = sys.argv[ 4 ] - data[ 'owner' ] = sys.argv[ 5 ] - data[ 'changeset_revision' ] = sys.argv[ 6 ] - data[ 'tool_panel_section_id' ] = sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision tool_panel_section_id' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -submit( sys.argv[ 1 ], sys.argv[ 2 ], data ) diff -r 7985a6d894359c8431e1a9a3a867edc8ff3aefc5 -r e54bbcffc6d7b6918b4a65e6855460e235b44b83 scripts/api/install_repository_tools_into_new_tool_panel_section.py --- a/scripts/api/install_repository_tools_into_new_tool_panel_section.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -""" -Install a specified repository revision from a specified tool shed into Galaxy. This example demonstrates installation of a repository that contains -valid tools, loading them into a new section of the Galaxy tool panel. The repository has no tool dependencies or repository dependencies, so only -a single repository will be installed. - -usage: ./install_repository_tools_into_new_tool_panel_section.py <api_key <galaxy base url> tool_shed_url name owner changeset_revision new_tool_panel_section_label - -Here is a working example of how to use this script to install a repository from the test tool shed. -./install_repository_tools_into_new_tool_panel_section.py <api key><galaxy base url>/api/tool_shed_repositories/new/install_repository_revision http://testtoolshed.g2.bx.psu.edu gregs_filter greg f28d5018f9cb 'From Test Tool Shed' -""" - -import os -import sys -sys.path.insert( 0, os.path.dirname( __file__ ) ) -from common import submit - -try: - assert sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision tool_panel_section_id' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -try: - data = {} - data[ 'tool_shed_url' ] = sys.argv[ 3 ] - data[ 'name' ] = sys.argv[ 4 ] - data[ 'owner' ] = sys.argv[ 5 ] - data[ 'changeset_revision' ] = sys.argv[ 6 ] - data[ 'new_tool_panel_section_label' ] = sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision new_tool_panel_section_label' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -submit( sys.argv[ 1 ], sys.argv[ 2 ], data ) diff -r 7985a6d894359c8431e1a9a3a867edc8ff3aefc5 -r e54bbcffc6d7b6918b4a65e6855460e235b44b83 scripts/api/install_repository_with_repository_dependencies.py --- a/scripts/api/install_repository_with_repository_dependencies.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -""" -Install a specified repository revision from a specified tool shed into Galaxy. This example demonstrates installation of a repository that has -repository dependencies, so multiple repositories will ultimately be installed. Since no Galaxy tool panel section information is used, all tools -contained in the installed repositories will be loaded into the Galaxy tool panel outside of any sections. - -usage: ./install_repository_with_repository_dependencies.py <api_key <galaxy base url> tool_shed_url name owner changeset_revision True - -Here is a working example of how to use this script to install a repository from the test tool shed. -./install_repository_with_repository_dependencies.py <api key><galaxy base url>/api/tool_shed_repositories/new/install_repository_revision http://testtoolshed.g2.bx.psu.edu emboss_5 devteam 8ddad0c9a75a True -""" - -import os -import sys -sys.path.insert( 0, os.path.dirname( __file__ ) ) -from common import submit - -try: - assert sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision install_repository_dependencies' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -try: - data = {} - data[ 'tool_shed_url' ] = sys.argv[ 3 ] - data[ 'name' ] = sys.argv[ 4 ] - data[ 'owner' ] = sys.argv[ 5 ] - data[ 'changeset_revision' ] = sys.argv[ 6 ] - data[ 'install_repository_dependencies' ] = sys.argv[ 7 ] -except IndexError: - print 'usage: %s key url tool_shed_url name owner changeset_revision install_repository_dependencies' % os.path.basename( sys.argv[ 0 ] ) - sys.exit( 1 ) - -submit( sys.argv[ 1 ], sys.argv[ 2 ], data ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.