--- OSAS/OSA_system/archive.py 2003/10/05 19:11:09 1.1
+++ OSAS/OSA_system/archive.py 2004/01/20 17:56:59 1.7
@@ -75,6 +75,7 @@ class filesystem(Implicit, Persistent, R
def getfs(self,start):
"""load filessystem"""
+
f = os.popen("find "+ start+" -name '*' ","r")
lines = f.readlines()
@@ -239,6 +240,7 @@ class filesystem2(Implicit, Persistent,
def getfs(self,start):
"""load filessystem"""
+
f = os.popen("find "+ start+" -name '*' ","r")
lines = f.readlines()
@@ -373,6 +375,7 @@ class browse(Implicit, Persistent, RoleM
def getfs(start):
"""return filesystem"""
+
f = os.popen("find "+ start+" -name '*'","r")
lines = f.readlines()
return lines
@@ -527,16 +530,17 @@ class metacheck(Implicit, Persistent, Ro
return [retstr,error]
else:
return ['','running']
+
def __init__(self,path):
"""archive the documents in path"""
self.lines=[]
if type(path)==StringType:
- f = os.popen("/usr/local/mpiwg/archive/metacheck "+path,"r")
+ f = os.popen("/usr/local/mpiwg/archive/metacheck "+path,"r")
self.lines.append(Error([path,self.parsearchive(f.readlines())]))
else:
for singlepath in path:
- f = os.popen("/usr/local/mpiwg/archive/metacheck "+singlepath,"r")
+ f = os.popen("/usr/local/mpiwg/archive/metacheck "+singlepath,"r")
self.lines.append(Error([singlepath,self.parsearchive(f.readlines())]))
security.declarePublic('messages')
@@ -636,13 +640,14 @@ def getText(nodelist):
rc = ""
for node in nodelist:
+
if node.nodeType == node.TEXT_NODE:
rc = rc + node.data
return rc
def getBib(nodelist):
rc= "
"
- print "HI"
+
for node in nodelist:
if node.nodeType == node.ELEMENT_NODE:
@@ -685,7 +690,7 @@ def getMetafile(path):
else:
html=html+"Info
"
html=html+getBib(bib.childNodes)
- print html
+ #print html
except:
"""none"""
@@ -734,18 +739,29 @@ def isdigilib2(path):
def isFullText(path,folder_name):
"""check if foldername in path is full text"""
+
try:
dom=xml.dom.minidom.parse(path+"/index.meta")
- for node in dom.getElementsByTagName("dir"):
-
- if getText(node.getElementsByTagName("content-type")[0].childNodes)=="fulltext":
-
+ except:
+ """ nothing"""
+ return 0
+ for node in dom.getElementsByTagName("dir"):
+
+ try:
+ child=getText(node.getElementsByTagName("content-type")[0].childNodes)
+
+ if child =="fulltext":
+
if getText(node.getElementsByTagName("name")[0].childNodes)==folder_name:
return 1
- return 0
- except:
+ except:
+ """nothing"""
+ #print "erro",node
+ #print sys.exc_info()
+ #return 0
- return 0
+ return 0
+
def isPresentation(path,folder_name):
@@ -853,10 +869,11 @@ class overview(Implicit,Persistent, Role
if not len(str)==0:
for line in str:
retstr=retstr+line+"
"
- check=re.search(r"(.*):(.*)",line)
- if check.group(1)=='ABORT':
+ check=line.split(":")
+ #re.search(r"(.*):(.*)",line)
+ if check[0]=='ABORT':
error="error"
- elif check.group(1)=='DONE':
+ elif check[0]=='DONE':
error="ok"
else:
error="running"
@@ -938,7 +955,7 @@ def EditIndex2(self):
if not self.REQUEST.has_key('fileupload'):
#newtext=urllib.unquote(self.REQUEST['indexmeta'])
newtext=self.REQUEST['indexmeta']
- print newtext
+ #print newtext
else:
self.file_name=self.REQUEST['fileupload'].filename
#newtext=self.REQUEST.form['fileupload'].read()