comparison TrustStoreGalaxyBrowse.py @ 2:3ff3e9b8794f

Fix output json format.
author Catherine Wise <catherine.wise@csiro.au>
date Thu, 21 May 2015 14:21:03 +1000
parents 07fda3da679b
children 34bdad74ec64
comparison
equal deleted inserted replaced
1:a9127799070f 2:3ff3e9b8794f
174 for location in locations: 174 for location in locations:
175 filename = "".join(c in SAFE_CHARS and c or '-' for c in location.name) 175 filename = "".join(c in SAFE_CHARS and c or '-' for c in location.name)
176 extension = os.path.splitext(filename)[1] 176 extension = os.path.splitext(filename)[1]
177 name = construct_multi_filename(hda_id, filename, extension) 177 name = construct_multi_filename(hda_id, filename, extension)
178 target_output_filename = None 178 target_output_filename = None
179 data_type = "dataset"
179 if first: 180 if first:
180 target_output_filename = file_name 181 target_output_filename = file_name
182 dataset = "new_primary_dataset"
181 first = False 183 first = False
182 else: 184 else:
183 target_output_filename = os.path.normpath("/".join([extra_files_path, name])) 185 target_output_filename = os.path.normpath("/".join([extra_files_path, name]))
184 metadata_file.write( 186 metadata_file.write(
185 metadata_to_json(dataset_id, filename, name, extension, target_output_filename)) 187 metadata_to_json(dataset_id, target_output_filename, name, extension, data_type))
186 download = truststore.getFile(store, location) 188 download = truststore.getFile(store, location)
187 if download is None: 189 if download is None:
188 print("File %s not found." % location.name) 190 print("File %s not found." % location.name)
189 sys.exit(4) 191 sys.exit(4)
190 ungzip(download, target_output_filename) 192 ungzip(download, target_output_filename)