--- MPIWGWeb/Attic/updatePersonalWWW.py 2010/04/26 15:22:47 1.1.2.8 +++ MPIWGWeb/Attic/updatePersonalWWW.py 2012/01/09 07:33:31 1.1.2.11 @@ -1,9 +1,5 @@ -try: - import psycopg2 as psycopg - psyco = 2 -except: - import psycopg - psyco = 1 +import psycopg2 as psycopg +psyco = 2 import logging from MPIWGHelper import unicodify, utf8ify @@ -16,7 +12,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 @@ -288,7 +285,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="" @@ -352,4 +349,4 @@ if __name__ == "__main__": # # print "DONE!" - \ No newline at end of file +