diff --git a/addons/document/std_index.py b/addons/document/std_index.py index bd61c65e16b..b54ff396480 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -21,7 +21,7 @@ import StringIO import odt2txt - +from subprocess import Popen, PIPE from content_index import indexer, cntIndex @@ -50,15 +50,28 @@ class TxtIndex(indexer): cntIndex.register(TxtIndex()) +class PptIndex(indexer): + def _getMimeTypes(self): + return [ 'application/ms-word'] + + def _getExtensions(self): + return ['.ppt','.pptx'] + + def _doIndexFile(self,fname): + fp = Popen(['ppthtml', fname], shell=False, stdout=PIPE).stdout + return _to_unicode( fp.read()) + +cntIndex.register(PptIndex()) + class DocIndex(indexer): def _getMimeTypes(self): return [ 'application/ms-word'] def _getExtensions(self): - return ['.doc'] + return ['.doc','.docx'] def _doIndexFile(self,fname): - fp = Popen(['antiword',fname], shell=False, stdout=PIPE).stdout + fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout return _to_unicode( fp.read()) cntIndex.register(DocIndex())