diff options
| author | Antonin Bourguignon <abo@openerp.com> | 2012-10-02 14:06:34 +0200 |
|---|---|---|
| committer | Antonin Bourguignon <abo@openerp.com> | 2012-10-02 14:06:34 +0200 |
| commit | c28dfb19e19ea9dde6de2ae5fb20cfec3860744e (patch) | |
| tree | 4fdff0732f33426af59c7792b8e727458afe913c /addons/document/std_index.py | |
| parent | 79b2a0f6c6017d984b15160b8be806ecf7131b3e (diff) | |
| parent | 2b2288a3bd29c096cc5eb70c4d966cfd32bffc45 (diff) | |
[MERGE] trunk-unmutable-defaults-abo: fix the last few methods that still have mutable defaults
also improve code style (methods signatures and whitespaces)
contribution of Lionel Sausin from Numerigraphe
bzr revid: abo@openerp.com-20121002120634-ms2ins653tktqfnt
Diffstat (limited to 'addons/document/std_index.py')
| -rw-r--r-- | addons/document/std_index.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/addons/document/std_index.py b/addons/document/std_index.py index 422590e127f..95c5e594c25 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -39,7 +39,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 : @@ -56,7 +56,7 @@ class TxtIndex(indexer): def _getExtensions(self): return ['.txt', '.py'] - def _doIndexContent(self,content): + def _doIndexContent(self, content): return content cntIndex.register(TxtIndex()) @@ -68,7 +68,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"" @@ -96,7 +96,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() @@ -116,7 +116,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 () : @@ -141,7 +141,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 () : @@ -165,7 +165,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) @@ -181,7 +181,7 @@ class ImageNoIndex(indexer): return [] #return ['.png','.jpg','.gif','.jpeg','.bmp','.tiff'] - def _doIndexContent(self,content): + def _doIndexContent(self, content): return 'image' |
