'Try to guess if the file is a CML file.
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname(\'interval.interval\')
>>> CML().sniff(fname)
False
>>> fname = get_test_fname(\'drugbank_drugs.cml\')
>>> CML().sniff(fname)
True'

def sniff(self, filename):

    handle = open(filename)
    line = handle.readline()
    if (line.strip() != '<?xml    version="1.0"?>'):
        handle.close()
        return False
    line = handle.readline()
    if (line.strip().find('http://www.xml-cml.org/schema') == (-1)):
        handle.close()
        return False
    handle.close()
    return True
