--- cdli/cdli_files.py 2006/10/04 07:18:23 1.45 +++ cdli/cdli_files.py 2006/10/05 07:22:58 1.48 @@ -1,5 +1,5 @@ """CDLI extensions of the filearchive""" -from Products.versionedFile.versionedFile import * +from Products.versionedFile.extVersionedFile import * from Products.ZCatalog.CatalogPathAwareness import CatalogAware from tempfile import mkstemp,mkdtemp import os.path @@ -141,7 +141,7 @@ class uploadATFfinallyThread(Thread): if len(founds)>0: SESSION['author']=str(username) self.result+="
Changing : %s"%fn - founds[0].getObject().manage_addCDLIFileObject('',comment,SESSION['author'],file=file(os.path.join(SESSION['tmpdir'],fn))) + founds[0].getObject().manage_addCDLIFileObject('',comment,SESSION['author'],file=os.path.join(SESSION['tmpdir'],fn,from_tmp=True)) #now add the new files @@ -310,28 +310,29 @@ class uploadATFThread(Thread): founds=ctx2.CDLICatalog.search({'title':fn}) #if not than add filename to the list of newfiles - - data=file(os.path.join(dir,fn)).read() - status,msg=checkFile(fn,data,dir) - - if not status: # error - errors.append((fn,msg)) - else: - if len(founds)==0: - newPs.append(fn) - - #if p file alread at the server - for found in founds: - #analyse the differences to the actual file - obj=found.getObject() - - if (not (str(obj.lockedBy))=='') and (not (str(obj.lockedBy)==str(self.username))): - lockerrors.append(fn) - else: - - diffs=obj.diff(data) - if diffs[0]>0: - changed.append((obj,diffs)) #hochladen + + data=file(os.path.join(dir,fn)).read() + #status,msg=checkFile(fn,data,dir) + status=True + msg="" + if not status: # error + errors.append((fn,msg)) + else: + if len(founds)==0: + newPs.append(fn) + + #if p file alread at the server + for found in founds: + #analyse the differences to the actual file + obj=found.getObject() + + if (not (str(obj.lockedBy))=='') and (not (str(obj.lockedBy)==str(self.username))): + lockerrors.append(fn) + else: + + diffs=obj.diff(data) + if diffs[0]>0: + changed.append((obj,diffs)) #hochladen #ready, set the returnValues self.result+="