--- OSAS/OSA_system/archive.py 2003/10/05 19:11:09 1.1 +++ OSAS/OSA_system/archive.py 2004/01/07 15:29:01 1.5 @@ -527,16 +527,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,6 +637,7 @@ def getText(nodelist): rc = "" for node in nodelist: + if node.nodeType == node.TEXT_NODE: rc = rc + node.data return rc @@ -734,18 +736,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):