summaryrefslogtreecommitdiff
path: root/addons/document/std_index.py
diff options
context:
space:
mode:
authorNumerigraphe - Lionel Sausin <ls@numerigraphe.fr>2012-03-05 19:40:03 +0100
committerNumerigraphe - Lionel Sausin <ls@numerigraphe.fr>2012-03-05 19:40:03 +0100
commit2d2a44dcf2e3b29e4fef4000792a064862967769 (patch)
tree3ead439725b24ab01fe5bd6e3784f9bffe12acdf /addons/document/std_index.py
parent520e2c680f927f16cfb97f543e2f73f7ab9ae7ac (diff)
[FIX] unmutable default in the remaining modules
[REF] coding style consistency lp bug: https://launchpad.net/bugs/525808 fixed bzr revid: ls@numerigraphe.fr-20120305184003-er00xtj9vtcw7gna
Diffstat (limited to 'addons/document/std_index.py')
-rw-r--r--addons/document/std_index.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/addons/document/std_index.py b/addons/document/std_index.py
index e153d018bf0..eb1da1a86e9 100644
--- a/addons/document/std_index.py
+++ b/addons/document/std_index.py
@@ -38,7 +38,7 @@ def _to_unicode(s):
except UnicodeError:
return s
-def textToString(element) :
+def textToString(element):
buffer = u""
for node in element.childNodes :
if node.nodeType == xml.dom.Node.TEXT_NODE :
@@ -55,7 +55,7 @@ class TxtIndex(indexer):
def _getExtensions(self):
return ['.txt', '.py']
- def _doIndexContent(self,content):
+ def _doIndexContent(self, content):
return content
cntIndex.register(TxtIndex())
@@ -67,7 +67,7 @@ class PptxIndex(indexer):
def _getExtensions(self):
return ['.pptx']
- def _doIndexFile(self,fname):
+ def _doIndexFile(self, fname):
def toString () :
""" Converts the document to a string. """
buffer = u""
@@ -95,7 +95,7 @@ class DocIndex(indexer):
def _getExtensions(self):
return ['.doc']
- def _doIndexFile(self,fname):
+ def _doIndexFile(self, fname):
try:
pop = Popen(['antiword', fname], shell=False, stdout=PIPE)
(data, _) = pop.communicate()
@@ -115,7 +115,7 @@ class DocxIndex(indexer):
def _getExtensions(self):
return ['.docx']
- def _doIndexFile(self,fname):
+ def _doIndexFile(self, fname):
zip = zipfile.ZipFile(fname)
content = xml.dom.minidom.parseString(zip.read("word/document.xml"))
def toString () :
@@ -140,7 +140,7 @@ class XlsxIndex(indexer):
def _getExtensions(self):
return ['.xlsx']
- def _doIndexFile(self,fname):
+ def _doIndexFile(self, fname):
zip = zipfile.ZipFile(fname)
content = xml.dom.minidom.parseString(zip.read("xl/sharedStrings.xml"))
def toString () :
@@ -164,7 +164,7 @@ class PdfIndex(indexer):
def _getExtensions(self):
return ['.pdf']
- def _doIndexFile(self,fname):
+ def _doIndexFile(self, fname):
pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE)
(data, _) = pop.communicate()
return _to_unicode(data)
@@ -180,7 +180,7 @@ class ImageNoIndex(indexer):
return []
#return ['.png','.jpg','.gif','.jpeg','.bmp','.tiff']
- def _doIndexContent(self,content):
+ def _doIndexContent(self, content):
return 'image'