Diff for /OSAS/OSA_system/OSAS_add.py between versions 1.5 and 1.6

version 1.5, 2003/10/13 22:24:35 version 1.6, 2003/12/05 14:57:03
Line 336  def addTextExternal(self,path,texturl,ve Line 336  def addTextExternal(self,path,texturl,ve
     writefile.close()      writefile.close()
           
     #registrieren      #registrieren
     urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines()      return urllib.urlopen("http://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%s"%path).readlines()
       
           
     return "DONE:"+textpath+"/"+name  
   
 def TextExternalError(text):  def TextExternalError(text):
     firsts=text[0:10]      firsts=text[0:10]
Line 419  def readArchimedesXML(folder): Line 419  def readArchimedesXML(folder):
     for item in items:      for item in items:
         #print item.attributes['dir'].value          #print item.attributes['dir'].value
         try:                  try:        
             dict[item.attributes['dir'].value]=item.attributes['uri'].value              dict[item.attributes['dir'].value]=item.attributes['xml'].value
             #print item.attributes['dir'].value,item.attributes['text'].value              #print item.attributes['dir'].value,item.attributes['text'].value
         except:          except:
             """nothing"""              """nothing"""
Line 499  def combineTextImage2(self,path): Line 499  def combineTextImage2(self,path):
     if self.REQUEST.has_key('text'):                  if self.REQUEST.has_key('text'):            
         textfile=os.listdir(path+"/"+self.REQUEST['text'])[0]          textfile=os.listdir(path+"/"+self.REQUEST['text'])[0]
         textfoldernode=dom.createElement('text')          textfoldernode=dom.createElement('text')
         textfoldernodetext=dom.createTextNode(self.REQUEST['text']+"/"+textfile)          textfoldernodetext=dom.createTextNode(path+"/"+self.REQUEST['text']+"/"+textfile)
         textfoldernode.appendChild(textfoldernodetext)          textfoldernode.appendChild(textfoldernodetext)
         subnode.appendChild(textfoldernode)          subnode.appendChild(textfoldernode)
   
Line 524  def combineTextImage2(self,path): Line 524  def combineTextImage2(self,path):
     node.appendChild(subnode)      node.appendChild(subnode)
   
     try:      try:
         node=dom.getElementsByTagName('bib')[0]          node2=node.getElementsByTagName('bib')[0]
         sub=dom.getElementsByTagName('lang')[0]          subs=node2.getElementsByTagName('lang')
               for sub in subs:
         node.removeChild(sub)              print "X",sub
               node2.removeChild(sub)
     except:      except:
         """nothing"""          """nothing"""
     try:      try:
         main=dom.getElementsByTagName('bib')[0]          main=dom.getElementsByTagName('bib')[0]
         node=dom.createElement('lang')          node=dom.createElement('lang')
         textnode=dom.createTextNode(self.REQUEST['lang'])          textnode=dom.createTextNode(self.REQUEST['lang'])
           print "LANG:",lang
         node.appendChild(textnode)          node.appendChild(textnode)
         main.appendChild(node)          main.appendChild(node)
     except:      except:
           try:
               subs=dom.getElementsByTagName('lang')
               main=dom.getElementsByTagName('resource')[0]
               for sub in subs:
                   main.removeChild(sub)
           except:
         """nothing"""          """nothing"""
           
           try:
               main=dom.getElementsByTagName('resource')[0]
               node=dom.createElement('lang')
               textnode=dom.createTextNode(self.REQUEST['lang'])
               #print "LANG:",self.REQUEST['lang']
               node.appendChild(textnode)
               main.appendChild(node)
           except:
               """nothing"""
               
     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()

Removed from v.1.5  
changed lines
  Added in v.1.6


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