# HG changeset patch # User lecorguille # Date 1435656965 14400 # Node ID 12afb0ecb55f3f339e429ca37b27dcf0ad818ba7 Uploaded diff -r 000000000000 -r 12afb0ecb55f README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Tue Jun 30 05:36:05 2015 -0400 @@ -0,0 +1,1 @@ +2014-09-08 INFO: no_unzip_datatypes is a perfect clone of the prims masscomb datatype FileSet diff -r 000000000000 -r 12afb0ecb55f datatypes_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datatypes_conf.xml Tue Jun 30 05:36:05 2015 -0400 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r 12afb0ecb55f no_unzip_datatypes.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/no_unzip_datatypes.py Tue Jun 30 05:36:05 2015 -0400 @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +""" +no_unzip_datatypes + +A perfect clone of the prims masscomb datatype FileSet +""" + +import logging +import zipfile +import os,os.path,re +from galaxy.datatypes.data import * +from galaxy.datatypes.xml import * +from galaxy.datatypes.sniff import * +from galaxy.datatypes.binary import * +from galaxy.datatypes.interval import * + +log = logging.getLogger(__name__) + + +class NoUnzip( Binary ): + """FileSet containing N files""" + file_ext = "no_unzip.zip" + blurb = "(zipped) FileSet containing multiple files" + + def sniff( self, filename ): + # If the zip file contains multiple files then return true, false otherwise: + zf = zipfile.ZipFile(filename) + if (len(zf.infolist())>1): + return True + else : + return False + + +# the if is just for backwards compatibility...could remove this at some point +if hasattr(Binary, 'register_sniffable_binary_format'): + Binary.register_sniffable_binary_format('NoUnzip', 'no_unzip.zip', NoUnzip) + + + + + + + + +