Mercurial > repos > da-intersect > test_ap11
view tar.py @ 19:f8e665ce6307
Uploaded
author | da-intersect |
---|---|
date | Thu, 11 Apr 2013 02:30:16 -0400 |
parents | 9a6f30d47f81 |
children | a984ba33efaf |
line wrap: on
line source
import tarfile import data import galaxy.util from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.binary import Binary from galaxy.datatypes import metadata from galaxy.datatypes.sniff import * class Tar( Binary ): """Class describing a BAM binary file""" file_ext = "tar" def sniff( self, filename ): try: if tarfile.is_tarfile(filename): return True except: return False def set_peek( self, dataset, is_multi_byte=False ): if not dataset.dataset.purged: dataset.peek = "Tar file" dataset.blurb = data.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 "Tar file"