comparison commons/core/sql/OldRepetDB.py @ 31:0ab839023fe4

Uploaded
author m-zytnicki
date Tue, 30 Apr 2013 14:33:21 -0400
parents 769e306b7933
children
comparison
equal deleted inserted replaced
30:5677346472b5 31:0ab839023fe4
1 import pyRepet.sql.RepetDBMySQL
2
3
4 class RepetDB ( pyRepet.sql.RepetDBMySQL.RepetDB ):
5
6 #TODO: try
7 def execute( self, qry, params=None ):
8 if params == None:
9 self.cursor.execute( qry )
10 else:
11 self.cursor.execute( qry, params )
12
13
14 ## Record a new table in the 'info_table' table
15 #
16 # @param tablename table name
17 # @param info information on the origin of the table
18 #
19 def updateInfoTable( self, tablename, info ):
20 self.execute( """SHOW TABLES""" )
21 results = self.fetchall()
22 if ("info_tables",) not in results:
23 sqlCmd = "CREATE TABLE info_tables ( name varchar(255), file varchar(255) )"
24 self.execute( sqlCmd )
25 qryParams = "INSERT INTO info_tables VALUES (%s, %s)"
26 params = ( tablename, info )
27 self.execute( qryParams,params )