version 1.31, 2010/05/10 15:50:32
|
version 1.32, 2011/05/20 16:03:18
|
Line 22 except:
|
Line 22 except:
|
|
|
fm_ns = 'http://www.filemaker.com/fmpxmlresult' |
fm_ns = 'http://www.filemaker.com/fmpxmlresult' |
|
|
version_string = "V0.6.5 ROC 10.5.2010" |
version_string = "V0.6.6 ROC 20.5.2011" |
|
|
def unicodify(text, withNone=False): |
def unicodify(text, withNone=False): |
"""decode str (utf-8 or latin-1 representation) into unicode object""" |
"""decode str (utf-8 or latin-1 representation) into unicode object""" |
Line 389 class xml_handler:
|
Line 389 class xml_handler:
|
|
|
if self.sync_mode: |
if self.sync_mode: |
# delete unmatched entries in db |
# delete unmatched entries in db |
|
if self.rowcnt > 0: |
self.logger.info("deleting unmatched rows from db") |
self.logger.info("deleting unmatched rows from db") |
delQuery = "DELETE FROM %s WHERE \"%s\" = %%s"%(self.table,self.id_field) |
delQuery = "DELETE FROM %s WHERE \"%s\" = %%s"%(self.table,self.id_field) |
for id in self.dbIDs.keys(): |
for id in self.dbIDs.keys(): |
Line 402 class xml_handler:
|
Line 403 class xml_handler:
|
|
|
self.dbCon.commit() |
self.dbCon.commit() |
|
|
|
else: |
|
# safety in case we had an empty file |
|
self.logger.warning("no rows read! not deleting unmatched rows!") |
|
|
# reinstate backup tables |
# reinstate backup tables |
if self.backup_table and not self.id_field: |
if self.backup_table and not self.id_field: |
backup_name = "%s_%s"%(self.orig_table,time.strftime('%Y_%m_%d_%H_%M_%S')) |
backup_name = "%s_%s"%(self.orig_table,time.strftime('%Y_%m_%d_%H_%M_%S')) |