Diff for /OSAS/OSA_system/OSAS_helpers.py between versions 1.7 and 1.9

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

Removed from v.1.7  
changed lines
  Added in v.1.9


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>