'Index Microsoft .pptx documents'

def _index_pptx(self, bin_data):

    buf = u''
    f = StringIO(bin_data)
    if zipfile.is_zipfile(f):
        try:
            zf = zipfile.ZipFile(f)
            zf_filelist = [x for x in zf.namelist() if x.startswith('ppt/slides/slide')]
            for i in range(1, (len(zf_filelist) + 1)):
                content = xml.dom.minidom.parseString(zf.read(('ppt/slides/slide%s.xml' % i)))
                for val in ['a:t']:
                    for element in content.getElementsByTagName(val):
                        buf += (textToString(element) + '\n')
        except Exception:
            pass
    return buf
