mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add a more correct zip file type.
This commit is contained in:
@@ -145,7 +145,7 @@
|
||||
<datatype extension="pbm" type="galaxy.datatypes.images:Pbm" mimetype="image/pbm"/>
|
||||
<datatype extension="pgm" type="galaxy.datatypes.images:Pgm" mimetype="image/pgm"/>
|
||||
<datatype extension="rna_eps" type="galaxy.datatypes.sequence:RNADotPlotMatrix" mimetype="image/eps" display_in_upload="True"/>
|
||||
<datatype extension="zip" type="galaxy.datatypes.binary:CompressedArchive" subclass="True" display_in_upload="True"/>
|
||||
<datatype extension="zip" type="galaxy.datatypes.binary:CompressedZipArchive" display_in_upload="True"/>
|
||||
<!-- Proteomics Datatypes -->
|
||||
<datatype extension="pepxml" type="galaxy.datatypes.proteomics:PepXml" mimetype="application/xml" display_in_upload="True"/>
|
||||
<datatype extension="raw_pepxml" type="galaxy.datatypes.proteomics:PepXml" mimetype="application/xml" subclass="True"/>
|
||||
|
||||
@@ -146,6 +146,31 @@ class CompressedArchive( Binary ):
|
||||
Binary.register_unsniffable_binary_ext("compressed_archive")
|
||||
|
||||
|
||||
class CompressedZipArchive( CompressedArchive ):
|
||||
"""
|
||||
Class describing an compressed binary file
|
||||
This class can be sublass'ed to implement archive filetypes that will not be unpacked by upload.py.
|
||||
"""
|
||||
file_ext = "zip"
|
||||
|
||||
def set_peek( self, dataset, is_multi_byte=False ):
|
||||
if not dataset.dataset.purged:
|
||||
dataset.peek = "Compressed zip file"
|
||||
dataset.blurb = nice_size( dataset.get_size() )
|
||||
else:
|
||||
dataset.peek = 'file does not exist'
|
||||
dataset.blurb = 'file purged from disk'
|
||||
|
||||
def display_peek( self, dataset ):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
return "Compressed zip file (%s)" % ( nice_size( dataset.get_size() ) )
|
||||
|
||||
|
||||
Binary.register_unsniffable_binary_ext("zip")
|
||||
|
||||
|
||||
class GenericAsn1Binary( Binary ):
|
||||
"""Class for generic ASN.1 binary format"""
|
||||
file_ext = "asn1-binary"
|
||||
|
||||
Reference in New Issue
Block a user