Diff for /MPIWGWeb/MPIWGProjects.py between versions 1.45 and 1.46

version 1.45, 2005/04/25 11:06:24 version 1.46, 2005/04/25 16:58:02
Line 36  def sortF(x,y): Line 36  def sortF(x,y):
         try:          try:
             return cmp(str(x[1]),str(y[1]))              return cmp(str(x[1]),str(y[1]))
         except:                     except:           
             print "error",x[1],y[1]              
             return 0               return 0 
           
 def sortI(x,y):  def sortI(x,y):
Line 299  class MPIWGRoot(ZSQLExtendFolder): Line 299  class MPIWGRoot(ZSQLExtendFolder):
                             list[urllib.quote(personNormal)]=(personNormal,[project[1]])                              list[urllib.quote(personNormal)]=(personNormal,[project[1]])
   
             except:              except:
                 print "ERROR",project                  zLOG.LOG("MPIWG Web (harvestHistoricalPerson)",zLOG.ERROR,"cannot annalyize: %s"%repr(project))
   
                                   
         return list          return list
   
Line 472  class MPIWGRoot(ZSQLExtendFolder): Line 473  class MPIWGRoot(ZSQLExtendFolder):
                     project._setObject(splitted[0],newObj)                      project._setObject(splitted[0],newObj)
                     #print "done:",splitted[0]                      #print "done:",splitted[0]
                 except:                  except:
                     print "not done:",splitted[0]                      zLOG.LOG("MPIWG Web (importNames)",zLOG.INFO,"cannot import: %s"%splitted[0])
   
                                           
         if RESPONSE is not None:          if RESPONSE is not None:
             RESPONSE.redirect('manage_main')              RESPONSE.redirect('manage_main')
Line 1041  class MPIWGProject(CatalogAware,Folder): Line 1043  class MPIWGProject(CatalogAware,Folder):
         """Inhalt des Feldes"""          """Inhalt des Feldes"""
                   
         text=u''          text=u''
         #print "FIELD",field  
         for x in getattr(self,field):          for x in getattr(self,field):
             #print "HIHIIII"  
                           
             try:              try:
                 text +=x.encode('utf-8')                  text +=x
             except:              except:
                 try:                  text = x
                     text =x.encode('utf-8')              
                 except:          
                     text=x.decode('latin-1').encode('utf-8')  
                   
         #delete separator (;) if  is there is one  
         ## try:  
 ##             print text, text[len(text)-1]  
 ##         except:  
 ##             print "error:",text  
         try:          try:
             if text[len(text)-1]==";":              if text[len(text)-1]==";":
                 text=text[0:len(text)-1]                  text=text[0:len(text)-1]
                       
                                   
         except:          except:
             """nothing"""              pass
   
           if text=='':
               text2=text
           else:
         text2=re.sub(r';([^\s])','; \g<1>',text)          text2=re.sub(r';([^\s])','; \g<1>',text)
   
         #teste ob ergebnis leer und header dann nehme title          #teste ob ergebnis leer und header dann nehme title
                   
         if (text2=='') and (field=='WEB_project_header'):          if (text2=='') and (field=='WEB_project_header'):
Line 1075  class MPIWGProject(CatalogAware,Folder): Line 1074  class MPIWGProject(CatalogAware,Folder):
         #teste ob WEB_project_description und keine führenden p tags          #teste ob WEB_project_description und keine führenden p tags
         if (len(text2)>4) and (not text2[0:3]=='<p>') and (field=='WEB_project_description'):          if (len(text2)>4) and (not text2[0:3]=='<p>') and (field=='WEB_project_description'):
             return "<p>"+text2+"</p>"              return "<p>"+text2+"</p>"
         #if text2=="Otto Sibum":  
         #text2="H. Otto Sibum"  
         return text2          return text2.encode('utf-8')
           
     def show_html(self):      def show_html(self):
         """simple index"""          """simple index"""
Line 1134  class MPIWGProject(CatalogAware,Folder): Line 1133  class MPIWGProject(CatalogAware,Folder):
   
     def isChecked(self,wert,list):      def isChecked(self,wert,list):
         """check if wert is in ; seperated list"""          """check if wert is in ; seperated list"""
         print "W:",wert  
         print "L:",list,type(list)  
         #felder sind manchmnal als liste mit einem element definiert          #felder sind manchmnal als liste mit einem element definiert
         if type(list) is StringType or UnicodeType:           if type(list) is StringType or UnicodeType: 
             splitted=list.split(";")              splitted=list.split(";")
         else:          else:
             splitted=list[0].split(";")              splitted=list[0].split(";")
   
         print splitted  
         for x in splitted:          for x in splitted:
             if (not x==u'') and x in wert:              if (not x==u'') and x in wert:
                 return 1                  return 1
Line 1196  def manage_addMPIWGProject(self,id,RESPO Line 1194  def manage_addMPIWGProject(self,id,RESPO
     #print argv      #print argv
     fileupload=self.REQUEST.get('fileupload',None)      fileupload=self.REQUEST.get('fileupload',None)
     if fileupload:      if fileupload:
         print fileupload  
         file_name=fileupload.filename          file_name=fileupload.filename
         filedata=fileupload.read()          filedata=fileupload.read()
                   

Removed from v.1.45  
changed lines
  Added in v.1.46


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