--- OSAS/OSA_system/OSAS_archiver.py 2004/01/07 10:46:30 1.7 +++ OSAS/OSA_system/OSAS_archiver.py 2004/01/07 15:29:01 1.8 @@ -31,9 +31,12 @@ class OSAS_archiveInbox(SimpleItem,Persi self.title=title self.pathes=[] - def addPath(self,path): + def addPath(self,path,RESPONSE=None): + """add a path""" today=time.localtime() self.pathes.append([path,today]) + if RESPONSE: + RESPONSE.redirect("index_html") def index_html(self): """main""" @@ -267,6 +270,7 @@ class OSAS_processViewer(SimpleItem,Pers return ret def writefile(self,path,txt,REQUEST): + """writefile""" f=open(path,'w') f.write(txt) f.close() @@ -312,19 +316,36 @@ class OSAS_archiver(Folder, Persistent,I {'label':'Main Config','action':'changeOSAS_archiverForm'}, ) - # to be deleted later - #startPath="/mpiwg" + def unarchive(self,path): + """unarchive the path""" + f = os.popen("/usr/local/mpiwg/archive/unarchiver "+path,"r") + return f.readlines() + + def checkIfUnarchive(self,path): + if not os.path.exists(path+"/index.meta"): + return 0 + f=file(path+"/index.meta","r").read() + dom=xml.dom.minidom.parseString(f) + archiveStorageDates=dom.getElementsByTagName("archive-storage-date") + if archiveStorageDates: + return 1 + else: + return 0 + ## methoden aus dem alten archive.py - + + def archiver(self,path): """archive the documents in path""" tmp=archive.archive(path,self.REQUEST.SESSION) pt=PageTemplateFile('Products/OSA_system/archiveStatus.zpt').__of__(self) return pt() - + def archive2(self): + pt=PageTemplateFile('Products/OSA_system/archive2.zpt').__of__(self) + return pt() def metachecker(self,path): @@ -467,11 +488,11 @@ class OSAS_archiver(Folder, Persistent,I return ret def writefile(self,path,txt,REQUEST): + """writefile""" f=open(path,'w') f.write(txt) f.close() - rval=self.aq_acquire('archive2') - return rval() + return self.archive2() def error(self): """view errors"""