PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/scripts/api/library_create_folder.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 21 lines | 18 code | 2 blank | 1 comment | 0 complexity | 33cd951411cfed0bac593ebb496a65d1 MD5 | raw file
 1#!/usr/bin/env python
 2
 3import os, sys
 4sys.path.insert( 0, os.path.dirname( __file__ ) )
 5from common import submit
 6
 7try:
 8    data = {}
 9    data[ 'folder_id' ] = sys.argv[3]
10    data[ 'name' ] = sys.argv[4]
11    data[ 'create_type' ] = 'folder'
12except IndexError:
13    print 'usage: %s key url folder_id name [description]' % os.path.basename( sys.argv[0] )
14    sys.exit( 1 )
15try:
16    data[ 'description' ] = sys.argv[5]
17except IndexError:
18    print "Unable to set description; using empty description in its place"
19    data[ 'description' ] = ''
20
21submit( sys.argv[1], sys.argv[2], data )