--- ZSQLExtend/importFMPXML.py 2009/02/10 17:54:00 1.29 +++ ZSQLExtend/importFMPXML.py 2009/11/17 18:21:28 1.30 @@ -22,7 +22,7 @@ except: fm_ns = 'http://www.filemaker.com/fmpxmlresult' -version_string = "V0.6.3 ROC 10.2.2009" +version_string = "V0.6.4 ROC 17.11.2009" def unicodify(text, withNone=False): """decode str (utf-8 or latin-1 representation) into unicode object""" @@ -205,7 +205,8 @@ class xml_handler: #First round through the generator corresponds to the #start element event self.logger.info("reading metadata...") - self.logger.debug("START METADATA") + if self.debug_data: + self.logger.debug("START METADATA") yield None #delegate is a generator that handles all the events "within" @@ -217,7 +218,8 @@ class xml_handler: yield None #Element closed. Wrap up - self.logger.debug("END METADATA") + if self.debug_data: + self.logger.debug("END METADATA") # rename table for backup if self.backup_table: @@ -367,7 +369,8 @@ class xml_handler: #First round through the generator corresponds to the #start element event self.logger.info("reading data...") - self.logger.debug("START RESULTSET") + if self.debug_data: + self.logger.debug("START RESULTSET") self.rowcnt = 0 yield None @@ -380,7 +383,8 @@ class xml_handler: yield None #Element closed. Wrap up - self.logger.debug("END RESULTSET") + if self.debug_data: + self.logger.debug("END RESULTSET") self.dbCon.commit() if self.sync_mode: @@ -409,6 +413,7 @@ class xml_handler: self.db.execute(qstr) self.dbCon.commit() + self.logger.info("Done (%s rows)"%self.rowcnt) return def handle_row(self, end_condition): @@ -416,7 +421,8 @@ class xml_handler: (saxtools.START_ELEMENT, fm_ns, u'COL'): self.handle_col, } - self.logger.debug("START ROW") + if self.debug_data: + self.logger.debug("START ROW") self.xml_data = {} self.colIdx = 0 yield None @@ -430,7 +436,8 @@ class xml_handler: yield None #Element closed. Wrap up - self.logger.debug("END ROW") + if self.debug_data: + self.logger.debug("END ROW") self.rowcnt += 1 # process collected row data update=False