--- cdli/cdli_files.py 2007/11/19 15:14:44 1.80.2.7 +++ cdli/cdli_files.py 2007/11/27 10:12:58 1.80.2.8 @@ -2167,6 +2167,7 @@ class CDLIRoot(Folder): def showWordInFile(self,fileId,word,indexName='graphemes',regExp=False,): """get lines with word from FileId""" + logging.debug("showwordinfile word='%s' index=%s file=%s"%(word,indexName,fileId)) file = formatAtfFullLineNum(self.getFile(fileId)) ret=[] @@ -2186,10 +2187,17 @@ class CDLIRoot(Folder): break return ret + + + def showWordInFiles(self,fileIds,word,indexName='graphemes',regExp=False): + """get lines with word from all ids in list FileIds""" + logging.debug("showwordinfiles word='%s' index=%s file=%s"%(word,indexName,fileIds)) + return [self.showWordInFile(id, word, indexName, regExp) for id in fileIds] def tagWordInFile(self,fileId,word,indexName='graphemes',regExp=False): """get text with word highlighted from FileId""" + logging.debug("tagwordinfile word='%s' index=%s file=%s"%(word,indexName,fileId)) file=self.getFile(fileId) tagStart=u'' @@ -2236,6 +2244,13 @@ class CDLIRoot(Folder): ret.append(line) return u'
\n'.join(ret) + + + + def tagWordInFiles(self,fileIds,word,indexName='graphemes',regExp=False): + """get texts with word from all ids in list FileIds""" + logging.debug("tagwordinfiles word='%s' index=%s file=%s"%(word,indexName,fileIds)) + return [self.tagWordInFile(id, word, indexName, regExp) for id in fileIds] def URLquote(self,str):