view commons/core/sql/OldRepetDB.py @ 14:c79b9ae3f65f

Deleted selected files
author m-zytnicki
date Fri, 19 Apr 2013 10:13:11 -0400
parents 769e306b7933
children
line wrap: on
line source

import pyRepet.sql.RepetDBMySQL


class RepetDB ( pyRepet.sql.RepetDBMySQL.RepetDB ):
    
    #TODO: try 
    def execute( self, qry, params=None ):
        if params == None:
            self.cursor.execute( qry )
        else:
            self.cursor.execute( qry, params )
            
            
    ## Record a new table in the 'info_table' table
    #
    # @param tablename table name
    # @param info information on the origin of the table
    # 
    def updateInfoTable( self, tablename, info ):
        self.execute( """SHOW TABLES""" )
        results = self.fetchall()
        if ("info_tables",) not in results:
            sqlCmd = "CREATE TABLE info_tables ( name varchar(255), file varchar(255) )"
            self.execute( sqlCmd )
        qryParams = "INSERT INTO info_tables VALUES (%s, %s)"
        params = ( tablename, info )
        self.execute( qryParams,params )