--- OSAS/OSA_system/OSAS_helpers.py 2004/04/15 20:48:01 1.7 +++ OSAS/OSA_system/OSAS_helpers.py 2008/09/05 11:42:55 1.9 @@ -20,12 +20,14 @@ def changeIndexMeta(argv,path,dirnames): if not argv['topbar']=='': subnodes['toptemplate']=argv['toptemplate'] - print path + try: - changeNodesInIndexMeta(path,"",subnodes) - urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines() + changeNodesInIndexMeta(path,'',subnodes,parent='texttool') + except: print "ERROR (changeIndexMeta)",path + + urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines() return "done" @@ -33,7 +35,7 @@ def changeIndexMeta(argv,path,dirnames): def readArchimedesXML(folder): """gib URL aus """ try: - XML=urllib.urlopen("http://archimedes.mpiwg-berlin.mpg.de/cgi-bin/toc/toc.cgi?step=xmlcorpusmanifest").read() + XML=urllib.urlopen("http://archimedes.mpiwg-berlin.mpg.de/cgi-bin/toc/toc.cgi?step=xmrpusmanifest").read() #print XML dom=xml.dom.minidom.parseString(XML) items=dom.getElementsByTagName('item') @@ -104,15 +106,18 @@ def changeNodesInIndexMeta(path,node,sub """nothing""" namenode=dom.createElement(re.sub(r' ','-',subnode)) - namenodetext=dom.createTextNode(unicode(subnodes[subnode],"utf8")) + namenodetext=dom.createTextNode(unide(subnodes[subnode],"utf8")) namenode.appendChild(namenodetext) root.appendChild(namenode) else: nodeOld=root.getElementsByTagName(node) - if nodeOld: # if yes -> delete it - root.removeChild(nodeOld[0]).unlink() + try: + if nodeOld: # if yes -> delete it + root.removeChild(nodeOld[0]).unlink() + except: + """nothing""" nodeNew=dom.createElement(node) # create new @@ -134,8 +139,10 @@ def changeNodesInIndexMeta(path,node,sub writefile=file(path+"/index.meta","w") writefile.write(dom.toxml().encode('utf-8')) writefile.close() - os.chmod(path+"/index.meta",0664) - + try: + os.chmod(path+"/index.meta",0664) + except: + """nothing"""