diff 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
line wrap: on
line diff
--- a/TrustStoreGalaxyBrowse.py	Thu May 21 14:21:03 2015 +1000
+++ b/TrustStoreGalaxyBrowse.py	Fri May 22 08:27:55 2015 +1000
@@ -173,16 +173,16 @@
                     print("Downloading file..." + ", ".join([loc.name for loc in locations]))
                 for location in locations:
                     filename = "".join(c in SAFE_CHARS and c or '-' for c in location.name)
-                    extension = os.path.splitext(filename)[1]
+                    extension = os.path.splitext(filename)[1].strip(".")
                     name = construct_multi_filename(hda_id, filename, extension)
                     target_output_filename = None
-                    data_type = "dataset"
+                    data_type = "new_primary_dataset"
                     if first:
                         target_output_filename = file_name
                         dataset = "new_primary_dataset"
                         first = False
                     else:
-                        target_output_filename = os.path.normpath("/".join([extra_files_path, name]))
+                        target_output_filename = os.path.normpath(os.path.join(extra_files_path, name))
                     metadata_file.write(
                         metadata_to_json(dataset_id, target_output_filename, name, extension, data_type))
                     download = truststore.getFile(store, location)