Lines Matching refs:self
32 def __init__(self, options):
33 self.name = options.db
34 self.host = options.host
35 self.user = options.user
36 self.passwd = options.passwd
37 self.mydb = None
38 self.cursor = None
40 def admin(self):
41 self.close()
42 self.mydb = MySQLdb.connect(db='mysql', host=self.host, user=self.user,
43 passwd=self.passwd)
44 self.cursor = self.mydb.cursor()
46 def connect(self):
47 self.close()
48 self.mydb = MySQLdb.connect(db=self.name, host=self.host,
49 user=self.user, passwd=self.passwd)
50 self.cursor = self.mydb.cursor()
52 def close(self):
53 if self.mydb is not None:
54 self.mydb.close()
55 self.cursor = None
57 def query(self, sql):
58 self.cursor.execute(sql)
60 def drop(self):
61 self.query('DROP DATABASE IF EXISTS %s' % self.name)
63 def create(self):
64 self.query('CREATE DATABASE %s' % self.name)
66 def populate(self):
89 self.query('''
157 self.query('''
214 self.query('''
246 self.query('''
270 self.query('''
296 self.query('''
316 self.query('''
336 self.query('''
344 def clean(self):
345 self.query('''
351 self.query('''
357 self.query('''
363 self.query('''
369 self.query('''
375 self.query('''
381 self.query('''