1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/3e43e8c42bc1/ changeset: 3e43e8c42bc1 user: greg date: 2013-03-21 15:58:11 summary: Move the tool_shed_repository_revision_update.py api example script to ~/lib/tool_shed/scripts/api affected #: 1 file diff -r cd766b6391448acae0574fcf240b4cf5c55d340e -r 3e43e8c42bc19eca2532989f83adbc8811062f62 lib/tool_shed/scripts/api/tool_shed_repository_revision_update.py --- /dev/null +++ b/lib/tool_shed/scripts/api/tool_shed_repository_revision_update.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +""" +PUT/update script to update appropriate values in a repository_metadata table record in the Tool Shed. + +usage: tool_shed_repository_revision_update.py key url key1=value1 key2=value2 ... +""" + +import os, sys +sys.path.insert( 0, os.path.dirname( __file__ ) ) +from common import update + +import pkg_resources +pkg_resources.require( "simplejson" ) + +import simplejson + +to_json_string = simplejson.dumps +from_json_string = simplejson.loads + +data = {} +for key, value in [ kwarg.split( '=', 1 ) for kwarg in sys.argv[ 3: ] ]: + """ + This example script will properly handle updating the value of one or more of the following RepositoryMetadata attributes: + tools_functionally_correct, do_not_test, tool_test_errors + """ + if key in [ 'tools_functionally_correct', 'do_not_test' ]: + if str( value ).lower() in [ 'true', 'yes', 'on' ]: + new_value = True + else: + new_value = False + elif key in [ 'tool_test_errors' ]: + new_value = from_json_string( value ) + else: + new_value = str( value ) + data[ key ] = new_value + +update( 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.