def convert(self):
        document, extension = os.path.splitext(self.filename)
        extension_from = extension.strip(".")

        if self.extension_to is None or self.extension_to == extension_from:
            self.file_obj.seek(0)
            content = self.file_obj.read()
            mime = magic.Magic( mime = True )
            mimetype = mime.from_buffer( content )
            return [mimetype, self.file_obj]
        try:
            #print "from: %s, to: %s" % (extension_from, self.extension_to)
            func = getattr(self, '%s_to_%s' % (extension_from, self.extension_to))
            return func()
        except __HOLE__:
            return (None, None)
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/libraries/adlibre/converter.py/NewFileConverter.convert