diff options
| author | Ysa (Open ERP) <ysa@tinyerp.co.in> | 2010-03-11 14:26:00 +0530 |
|---|---|---|
| committer | Ysa (Open ERP) <ysa@tinyerp.co.in> | 2010-03-11 14:26:00 +0530 |
| commit | d217272611da605662aa8df6a6e94271a7cfeba3 (patch) | |
| tree | 5ecf89299dfbe06a45cb2f988ef4b72d57aef9dd /addons/document | |
| parent | e7fb07589f310a2e1b2d4d8ca8cdea3d7d2a3837 (diff) | |
[IMP] document :- support indexation of .docx to text and PPTX to html
bzr revid: ysa@tinyerp.co.in-20100311085600-4t4gmuzywglpugh0
Diffstat (limited to 'addons/document')
| -rw-r--r-- | addons/document/std_index.py | 19 |
1 files changed, 16 insertions, 3 deletions
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()) |
