Mercurial > repos > melissacline > ucsc_cancer_utilities
changeset 37:e81019e3ac99
Updated synapseGetDataset to look at the filename rather than the (no longer existant) content type field to determine if the data is in zip format
author | melissacline |
---|---|
date | Mon, 27 Jul 2015 16:29:24 -0700 |
parents | ab161b5ac9cc |
children | 84eb11adc22f |
files | synapseGetDataset.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/synapseGetDataset.py Mon Jul 27 15:55:22 2015 -0700 +++ b/synapseGetDataset.py Mon Jul 27 16:29:24 2015 -0700 @@ -3,6 +3,7 @@ import argparse import json +import re import synapseclient import sys import zipfile @@ -23,7 +24,7 @@ fp.close() def saveData(entity, dataPathname): - if entity.properties['contentType'] == "application/zip": + if re.search("\.zip$", entity.path): zf = zipfile.ZipFile(entity.path) if len(zf.namelist()) > 1: raise InputError(len(zf.namelist())), "Error: more than one input file"