--- OSAS/OSA_system/OSAS_archiver.py 2004/01/07 10:46:30 1.7 +++ OSAS/OSA_system/OSAS_archiver.py 2004/01/09 12:47:04 1.10 @@ -31,9 +31,14 @@ 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]) + temp=self.pathes[0:] + temp.append([path,today]) + self.pathes=temp[0:] + if RESPONSE: + RESPONSE.redirect("index_html") def index_html(self): """main""" @@ -267,6 +272,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,23 +318,45 @@ 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 isArray(self,path): + """check for array""" + if type(path) == StringType: + return 0 + else: + return 1 + 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): - """check the metadata the documents in path""" + """check the metadata of the documents in path""" self.REQUEST.SESSION['path']=self.REQUEST['path'] return archive.metacheck(path) @@ -365,7 +393,6 @@ class OSAS_archiver(Folder, Persistent,I def getfilesystem2(self,start,reload=0): """load filesystem""" - k=filesystem2(start,1) return k @@ -467,11 +494,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"""