Diff for /MPIWGWeb/Attic/updatePersonalWWW.py between versions 1.1.2.2 and 1.1.2.7

version 1.1.2.2, 2007/04/19 12:18:50 version 1.1.2.7, 2009/04/28 13:47:04
Line 10  import logging Line 10  import logging
 from xml import sax  from xml import sax
 from amara import saxtools  from amara import saxtools
   
   # namespace for FileMaker8
 fm_ns = 'http://www.filemaker.com/fmpxmlresult'  fm_ns = 'http://www.filemaker.com/fmpxmlresult'
   
   # 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','home_inst','current_work','e_mail2']
 checkFields=['key','first_name','last_name','title','home_inst','e_mail2']  checkFields=['key','first_name','last_name','title','titles_new','home_inst','e_mail2']
   
 def sql_quote(v):  def sql_quote(v):
     # quote dictionary      # quote dictionary
Line 211  class xml_handler: Line 213  class xml_handler:
   
 def checkImport(dsn,resultSet):  def checkImport(dsn,resultSet):
     #now connect to the database      #now connect to the database
       logging.info("dsn: %s"%dsn)
     dbCon = psycopg.connect(dsn)      dbCon = psycopg.connect(dsn)
     db = dbCon.cursor()      db = dbCon.cursor()
           
Line 288  def checkForConflicts(cursor,dataSet,key Line 291  def checkForConflicts(cursor,dataSet,key
         else:          else:
             dbValue=""              dbValue=""
                           
           if checkField in dataSet:
         setValue=dataSet[checkField]          setValue=dataSet[checkField]
         logging.debug( "             %s %s %s %s"%(repr(key),checkField,repr(dbValue),repr(setValue)))          logging.debug( "             %s %s %s %s"%(repr(key),checkField,repr(dbValue),repr(setValue)))
         if dbValue.strip().rstrip()!=setValue.lstrip().rstrip():          if dbValue.strip().rstrip()!=setValue.lstrip().rstrip():
             ret.append((checkField,dbValue,setValue))              ret.append((checkField,dbValue,setValue))
             retValue=True              retValue=True
                   
           else:
               logging.warning("unknown field %s in data file!"%checkField)
               
         i+=1          i+=1
           
     return retValue,ret      return retValue,ret

Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.7


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