(self, tableValues)
Adds the values of specific table to the xml.
        The values are organized according to the relevant row and column.
Adds the values of specific table to the xml.
        The values are organized according to the relevant row and column.
Adds the values of specific table to the xml . The values are organized according to the relevant row and column .
def dbTableValues(self, tableValues):
        '''
        Adds the values of specific table to the xml.
        The values are organized according to the relevant row and column.
        '''
        tableElem = self.__doc.createElement(DB_TABLE_VALUES_ELEM_NAME)
        if (tableValues is not None):
            db = tableValues["__infos__"]["db"]
            if not db:
                db = "All"
            table = tableValues["__infos__"]["table"]

            count = int(tableValues["__infos__"]["count"])
            columns = tableValues.keys()
            columns.sort(key=lambda x: x.lower())

            tableElem.setAttributeNode(self._createAttribute(DB_ATTR, db))
            tableElem.setAttributeNode(self._createAttribute(NAME_ATTR, table))

            for i in range(count):
                rowElem = self.__doc.createElement(ROW_ELEM_NAME)
                tableElem.appendChild(rowElem)
                for column in columns:
                    if column != "__infos__":
                        info = tableValues[column]
                        value = info["values"][i]

                        if re.search("^[\ *]*$", value):
                            value = "NULL"

                        cellElem = self.__doc.createElement(CELL_ELEM_NAME)
                        cellElem.setAttributeNode(self._createAttribute(COLUMN_ATTR, column))
                        cellElem.appendChild(self._createTextNode(value))
                        rowElem.appendChild(cellElem)

        dbValuesElem = self._getRootChild(DB_VALUES_ELEM)
        if (not(dbValuesElem)):
            dbValuesElem = self.__doc.createElement(DB_VALUES_ELEM)
            self._addToRoot(dbValuesElem)

        dbValuesElem.appendChild(tableElem)

        logger.info("Table '%s.%s' dumped to XML file" % (db, table))
def dbTableValues ( self , tableValues ) : tableElem = self . __doc . createElement ( DB_TABLE_VALUES_ELEM_NAME ) if ( tableValues is not None ) : db = tableValues [ "__infos__" ] [ "db" ] if not db : db = "All" table = tableValues [ "__infos__" ] [ "table" ] count = int ( tableValues [ "__infos__" ] [ "count" ] ) columns = tableValues . keys ( ) columns . sort ( key = lambda x : x . lower ( ) ) tableElem . setAttributeNode ( self . _createAttribute ( DB_ATTR , db ) ) tableElem . setAttributeNode ( self . _createAttribute ( NAME_ATTR , table ) ) for i in range ( count ) : rowElem = self . __doc . createElement ( ROW_ELEM_NAME ) tableElem . appendChild ( rowElem ) for column in columns : if column != "__infos__" : info = tableValues [ column ] value = info [ "values" ] [ i ] if re . search ( "^[\ *]*$" , value ) : value = "NULL" cellElem = self . __doc . createElement ( CELL_ELEM_NAME ) cellElem . setAttributeNode ( self . _createAttribute ( COLUMN_ATTR , column ) ) cellElem . appendChild ( self . _createTextNode ( value ) ) rowElem . appendChild ( cellElem ) dbValuesElem = self . _getRootChild ( DB_VALUES_ELEM ) if ( not ( dbValuesElem ) ) : dbValuesElem = self . __doc . createElement ( DB_VALUES_ELEM ) self . _addToRoot ( dbValuesElem ) dbValuesElem . appendChild ( tableElem ) logger . info ( "Table '%s.%s' dumped to XML file" % ( db , table ) )