--- MPIWGWeb/Attic/updatePersonalWWW.py 2009/04/28 13:47:04 1.1.2.7 +++ MPIWGWeb/Attic/updatePersonalWWW.py 2011/05/18 12:36:06 1.1.2.10 @@ -6,6 +6,7 @@ except: psyco = 1 import logging +from MPIWGHelper import unicodify, utf8ify from xml import sax from amara import saxtools @@ -15,7 +16,8 @@ fm_ns = 'http://www.filemaker.com/fmpxml # list of fields that are taken from XML and checked against DB as conflicts #checkFields=['key','first_name','last_name','title','home_inst','current_work','e_mail2'] -checkFields=['key','first_name','last_name','title','titles_new','home_inst','e_mail2'] +checkFields=['key','first_name','last_name','title','titles_new','home_inst','current_work'] + def sql_quote(v): # quote dictionary @@ -225,7 +227,7 @@ def checkImport(dsn,resultSet): keys=[] for x in results: if x[0]: - keys.append(x[0].decode('utf-8')) + keys.append(unicodify(x[0])) #first step detect new entries and conflicts @@ -287,7 +289,7 @@ def checkForConflicts(cursor,dataSet,key for checkField in checkFields: dbValueR=sr[0][i] if dbValueR: - dbValue=dbValueR.decode('utf-8') + dbValue=unicodify(dbValueR) else: dbValue="" @@ -351,4 +353,4 @@ if __name__ == "__main__": # # print "DONE!" - \ No newline at end of file +