changeset 20:91bad9ac39c6

This is giving me a headache.
author Wise, Catherine (Digital, Acton) <Catherine.Wise@csiro.au>
date Thu, 25 Jun 2015 13:11:57 +1000
parents bae7471a4741
children 4819fbb59766
files TrustStoreGalaxyBrowse.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/TrustStoreGalaxyBrowse.py	Thu Jun 25 13:02:16 2015 +1000
+++ b/TrustStoreGalaxyBrowse.py	Thu Jun 25 13:11:57 2015 +1000
@@ -198,18 +198,19 @@
                     data_type = "new_primary_dataset"
                     target_output_filename = os.path.normpath(os.path.join(extra_files_path, name))
                     download = truststore.getFile(store, location)
+                    primary = first
                     if download is None:
                         print("File %s not found." % location.name)
                         sys.exit(4)
                     if first:
                         first = False
-                        target_output_filename = download
+                        target_output_filename = file_name
+                        data_type = "dataset"
                     ungzip(download, target_output_filename)
+                    metadata_file.write(
+                        metadata_to_json(dataset_id, target_output_filename, name, extension, data_type, primary=primary))
                     # ext = sniff.handle_uploaded_dataset_file(target_output_filename, datatypes_registry, ext=ext)
                     # print("Guessed file type: " + ext)
-                    print("in file: " + properties_file)
-                    metadata_file.write(
-                        metadata_to_json(dataset_id, target_output_filename, name, extension, data_type))
     else:
         print("Store is damaged or we don't have sufficient access.")
         sys.exit(4)