Mercurial > repos > cathywise > truststore_browse
comparison TrustStoreGalaxyBrowse.py @ 3:34bdad74ec64
Fix json output again.
| author | Catherine Wise <catherine.wise@csiro.au> |
|---|---|
| date | Fri, 22 May 2015 08:27:55 +1000 |
| parents | 3ff3e9b8794f |
| children | 2ca750b9083c |
comparison
equal
deleted
inserted
replaced
| 2:3ff3e9b8794f | 3:34bdad74ec64 |
|---|---|
| 171 print("In root: " + str(root)) | 171 print("In root: " + str(root)) |
| 172 else: | 172 else: |
| 173 print("Downloading file..." + ", ".join([loc.name for loc in locations])) | 173 print("Downloading file..." + ", ".join([loc.name for loc in locations])) |
| 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].strip(".") |
| 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 data_type = "new_primary_dataset" |
| 180 if first: | 180 if first: |
| 181 target_output_filename = file_name | 181 target_output_filename = file_name |
| 182 dataset = "new_primary_dataset" | 182 dataset = "new_primary_dataset" |
| 183 first = False | 183 first = False |
| 184 else: | 184 else: |
| 185 target_output_filename = os.path.normpath("/".join([extra_files_path, name])) | 185 target_output_filename = os.path.normpath(os.path.join(extra_files_path, name)) |
| 186 metadata_file.write( | 186 metadata_file.write( |
| 187 metadata_to_json(dataset_id, target_output_filename, name, extension, data_type)) | 187 metadata_to_json(dataset_id, target_output_filename, name, extension, data_type)) |
| 188 download = truststore.getFile(store, location) | 188 download = truststore.getFile(store, location) |
| 189 if download is None: | 189 if download is None: |
| 190 print("File %s not found." % location.name) | 190 print("File %s not found." % location.name) |
