Files
galaxy/scripts/api/sample_update_state.py
T
Nicola Soranzo d85db9daa6 Use __file__ when adding paths to sys.path instead of os.getcwd() .
Also insert additional paths in position 1 unless strictly necessary.
2016-02-18 15:45:15 +00:00

20 lines
444 B
Python
Executable File

#!/usr/bin/env python
import os
import sys
from common import update
try:
data = {}
data[ 'update_type' ] = 'sample_state'
data[ 'new_state' ] = sys.argv[3]
except IndexError:
print 'usage: %s key url new_state [comment]' % os.path.basename( sys.argv[0] )
sys.exit( 1 )
try:
data[ 'comment' ] = sys.argv[4]
except IndexError:
data[ 'comment' ] = ''
update( sys.argv[1], sys.argv[2], data, return_formatted=True )