--- cdli/cdli_files.py 2008/01/14 18:43:21 1.80.2.15 +++ cdli/cdli_files.py 2008/06/26 18:08:02 1.82 @@ -108,7 +108,7 @@ def formatAtfFullLineNum(txt, nolemma=Tr surf = line.replace(words[0],surfaces[words[0]]).strip() elif words[0] == '@column': - col = words[1] + col = ' '.join(words[1:]) elif line and line[0] in '123456789': # ordinary line -> add line number @@ -1532,11 +1532,12 @@ class CDLIFileObject(CatalogAware,extVer def makeThisVersionCurrent(self,comment,author,RESPONSE=None): """copy this version to current""" parent=self.aq_parent - newversion=parent.manage_addCDLIFileObject('',comment,author) - newversion.manage_upload(self.getData()) + parent.manage_addVersionedFileObject(id=None,vC=comment,author=author,file=self.getData(),RESPONSE=RESPONSE) + #newversion=parent.manage_addCDLIFileObject('',comment,author) + #newversion.manage_upload(self.getData()) - if RESPONSE is not None: - RESPONSE.redirect(self.aq_parent.absolute_url()+'/history') + #if RESPONSE is not None: + # RESPONSE.redirect(self.aq_parent.absolute_url()+'/history') return True @@ -2156,7 +2157,6 @@ class CDLIRoot(Folder): return f[0].getObject().getData() - def showFile(self,fileId,wholePage=False): """show a file @param fileId: P-Number of the document to be displayed @@ -2237,7 +2237,7 @@ class CDLIRoot(Folder): # split search terms again (for grapheme search with words) splitwords = dict(((w,self.splitter[indexName].process([w])) for w in words)) - for line in file.linesplit(): + for line in file.splitlines(): line = unicodify(line) # ignore lemma and other lines if line.lstrip().startswith('#lem:'): @@ -2295,6 +2295,15 @@ class CDLIRoot(Folder): return dict([(id,self.tagWordInFile(id, word, indexName, regExp)) for id in fileIds]) + def getFileVersionList(self, pnum): + """get the version history as a list for the translit file with the given pnum""" + f = getattr(self, self.file_catalog).search({'textid':pnum}) + if not f: + return [] + + return f[0].getObject().getVersionList() + + def URLquote(self,str): """quote url""" return urllib.quote(str)