--- OSAS/OSA_system/OSAS_show.py 2004/01/06 14:39:49 1.12 +++ OSAS/OSA_system/OSAS_show.py 2004/01/21 07:43:01 1.14 @@ -100,7 +100,7 @@ class OSAS_StoreOnline(SimpleItem): return [] def rescaleThumbs(self,path): - """rescale thumbs of imeages in path""" + """rescale thumbs of images in path""" os.popen("ssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 --replace >> /tmp/sc.out &"% re.sub('/mpiwg/online/','',self.REQUEST['path'])) @@ -148,21 +148,22 @@ class OSAS_StoreOnline(SimpleItem): return isFolder(self,path) def isScannedDocument(self,path): - """Test ob Eintrag ein Folder ist""" + """Test ob Eintrag ein Scanned Document ist""" return isScannedDocument(self,path) def isFullText(self,path,folder_name): """Test ob Eintrag ein Folder ist""" return isFullText(path,folder_name) + def date(self): + return strftime("%d.%m.%Y",localtime()) + def addFolderForm(self,path): """add a new path""" pt=PageTemplateFile('Products/OSA_system/OSAS_addFolder.zpt').__of__(self) return pt() - def date(self): - return strftime("%d.%m.%Y",localtime()) - + def addFolder(self,path,folder_name,description,archive_creation_date,creator): """add the folder to the filesystem and write the metadata files""" return addFolder.addFolder(self,path,folder_name,description,archive_creation_date,creator) @@ -174,6 +175,7 @@ class OSAS_StoreOnline(SimpleItem): indexmeta=dom.toxml() except: indexmeta="" + self.REQUEST.SESSION['indexmeta']=indexmeta self.REQUEST.SESSION['path']=path newtemplate=PageTemplateFile('Products/OSA_system/editindex').__of__(self) @@ -377,27 +379,29 @@ class filesystem(Implicit, Persistent, R def archive_the_path(self,path): """parse indexmeta and return digilib path""" + try: #f = os.popen("cat "+path+"/index.meta","r") f =file(path+"/index.meta","r") lines = f.read() - + try: dom = xml.dom.minidom.parseString(lines) - if getText(dom.getElementsByTagName("content-type")[0].childNodes)=="folder": - """folder nicht archivieren""" - return 0 + if dom.getElementsByTagName("content-type"): + if getText(dom.getElementsByTagName("content-type")[0].childNodes)=="folder": + """folder nicht archivieren""" + return 0 + + archive_storage_date=getText(dom.getElementsByTagName("archive-storage-date")[0].childNodes) + + if archive_storage_date=="": + + """leer also archivieren""" + return 1 else: - archive_storage_date=getText(dom.getElementsByTagName("archive-storage-date")[0].childNodes) - - if archive_storage_date=="": - - """leer also archivieren""" - return 1 - else: - """nicht archivieren""" - return 0 + """nicht archivieren""" + return 0 except: """kein tag also archivieren""" return 1 @@ -477,6 +481,7 @@ class filesystem2(Implicit, Persistent, def getfs(self,start): """load filessystem""" + f = os.popen("find "+ start+" -name '*' ","r") lines = f.readlines() @@ -612,6 +617,8 @@ class browse(Implicit, Persistent, RoleM def getfs(start): """return filesystem""" + + f = os.popen("find "+ start+" -name '*'","r") lines = f.readlines() return lines @@ -882,7 +889,7 @@ def getBib(nodelist): return rc+"" def getMetafile(path): - """get index.meta""" + """get index.meta and translate it to an HTML""" html=[] if not os.path.exists(path+"/index.meta"):