--- MPIWGWeb/MPIWGProjects.py 2005/04/25 11:06:24 1.45 +++ MPIWGWeb/MPIWGProjects.py 2005/04/25 16:58:02 1.46 @@ -36,7 +36,7 @@ def sortF(x,y): try: return cmp(str(x[1]),str(y[1])) except: - print "error",x[1],y[1] + return 0 def sortI(x,y): @@ -299,7 +299,8 @@ class MPIWGRoot(ZSQLExtendFolder): list[urllib.quote(personNormal)]=(personNormal,[project[1]]) except: - print "ERROR",project + zLOG.LOG("MPIWG Web (harvestHistoricalPerson)",zLOG.ERROR,"cannot annalyize: %s"%repr(project)) + return list @@ -472,7 +473,8 @@ class MPIWGRoot(ZSQLExtendFolder): project._setObject(splitted[0],newObj) #print "done:",splitted[0] except: - print "not done:",splitted[0] + zLOG.LOG("MPIWG Web (importNames)",zLOG.INFO,"cannot import: %s"%splitted[0]) + if RESPONSE is not None: RESPONSE.redirect('manage_main') @@ -1041,32 +1043,29 @@ class MPIWGProject(CatalogAware,Folder): """Inhalt des Feldes""" text=u'' - #print "FIELD",field + for x in getattr(self,field): - #print "HIHIIII" try: - text +=x.encode('utf-8') + text +=x except: - try: - text =x.encode('utf-8') - except: - text=x.decode('latin-1').encode('utf-8') + text = x + - #delete separator (;) if is there is one - ## try: -## print text, text[len(text)-1] -## except: -## print "error:",text + try: if text[len(text)-1]==";": text=text[0:len(text)-1] 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 if (text2=='') and (field=='WEB_project_header'): @@ -1075,9 +1074,9 @@ class MPIWGProject(CatalogAware,Folder): #teste ob WEB_project_description und keine führenden p tags if (len(text2)>4) and (not text2[0:3]=='

') and (field=='WEB_project_description'): return "

"+text2+"

" - #if text2=="Otto Sibum": - #text2="H. Otto Sibum" - return text2 + + + return text2.encode('utf-8') def show_html(self): """simple index""" @@ -1134,15 +1133,14 @@ class MPIWGProject(CatalogAware,Folder): def isChecked(self,wert,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 if type(list) is StringType or UnicodeType: splitted=list.split(";") else: splitted=list[0].split(";") - print splitted + for x in splitted: if (not x==u'') and x in wert: return 1 @@ -1196,7 +1194,7 @@ def manage_addMPIWGProject(self,id,RESPO #print argv fileupload=self.REQUEST.get('fileupload',None) if fileupload: - print fileupload + file_name=fileupload.filename filedata=fileupload.read()