version 1.1.2.1, 2007/04/18 10:03:13
|
version 1.1.2.6, 2009/04/28 13:35:17
|
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','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 314 if __name__ == "__main__":
|
Line 317 if __name__ == "__main__":
|
datefmt='%H:%M:%S') |
datefmt='%H:%M:%S') |
|
|
resultSet=importFMPXML(filename="/Users/dwinter/Desktop/personalwww.xml") |
resultSet=importFMPXML(filename="/Users/dwinter/Desktop/personalwww.xml") |
news,conflicts=checkImport(dsn="dbname=personalwww", resultSet=resultSet) |
news,conflicts=checkImport(dsn="dbname=personalwww host=xserve02a user=mysql password=e1nste1n", resultSet=resultSet) |
|
|
|
|
print "new" |
print "new" |