commit/galaxy-central: dan: Small fix for setting upload path in GenomeSpace export tool.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/40abca016f1e/ changeset: 40abca016f1e user: dan date: 2012-03-30 23:08:35 summary: Small fix for setting upload path in GenomeSpace export tool. affected #: 1 file diff -r de97f00ff16feb64cd26d3393a68c303f33e5e33 -r 40abca016f1ebd7be7adb362614eb16d8f2116bf tools/genomespace/genomespace_exporter.py --- a/tools/genomespace/genomespace_exporter.py +++ b/tools/genomespace/genomespace_exporter.py @@ -49,7 +49,8 @@ def get_directory( url_opener, dm_url, path ): url = dm_url - for sub_path in path: + i = None + for i, sub_path in enumerate( path ): url = "%s/%s" % ( url, sub_path ) dir_request = urllib2.Request( url, headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' } ) dir_request.get_method = lambda: 'GET' @@ -59,10 +60,14 @@ #print "e", e, url #punting, assuming lack of permisions at this low of a level... continue break - return dir_dict + if i is not None: + path = path[i+1:] + else: + path = [] + return ( dir_dict, path ) def get_default_directory( url_opener, dm_url ): - return get_directory( url_opener, dm_url, ["defaultdirectory"] ) + return get_directory( url_opener, dm_url, ["defaultdirectory"] )[0] def create_directory( url_opener, directory_dict, new_dir, dm_url ): payload = { "isDirectory": True } @@ -142,8 +147,8 @@ dm_url = genomespace_site_dict['dmServer'] #get default directory if target_directory and target_directory[0] == '/': - directory_dict = get_directory( url_opener, dm_url, [ "%s/%s/%s" % ( GENOMESPACE_API_VERSION_STRING, 'file', target_directory[1] ) ] + target_directory[2:] )['directory'] - target_directory.pop(0) + directory_dict, target_directory = get_directory( url_opener, dm_url, [ "%s/%s/%s" % ( GENOMESPACE_API_VERSION_STRING, 'file', target_directory[1] ) ] + target_directory[2:] ) + directory_dict = directory_dict['directory'] else: directory_dict = get_default_directory( url_opener, dm_url )['directory'] #what directory to stuff this in 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.
participants (1)
-
Bitbucket