[FIX]Bug:bug fix and set error message for doc type files
bzr revid: sgo@tinyerp.com-20111219093156-yern0qjj3vz7gpsf
This commit is contained in:
parent
0309ea7454
commit
560b296a3b
|
@ -95,9 +95,15 @@ class DocIndex(indexer):
|
|||
return ['.doc']
|
||||
|
||||
def _doIndexFile(self,fname):
|
||||
pop = Popen(['antiword', fname], shell=False, stdout=PIPE)
|
||||
(data, _) = pop.communicate()
|
||||
return _to_unicode(data)
|
||||
try:
|
||||
pop = Popen(['antiword', fname], shell=False, stdout=PIPE)
|
||||
(data, _) = pop.communicate()
|
||||
return _to_unicode(data)
|
||||
except:
|
||||
import netsvc
|
||||
logger = netsvc.Logger()
|
||||
logger.notifyChannel("document", netsvc.LOG_ERROR, 'Please install Antiword package(MS Word reader): sudo apt-get install antiword')
|
||||
return False
|
||||
|
||||
cntIndex.register(DocIndex())
|
||||
|
||||
|
|
Loading…
Reference in New Issue