From: Mariana Mărășoiu Date: Sun, 28 Aug 2011 17:45:36 +0000 (+0300) Subject: ppf/new: In storage.py: MySQLDatabaseAccess class receives as argument in initialisat... X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=4cfb3344e3f1cea7ca070905d50a39405b8fa9af;p=cs-p2p-next.git ppf/new: In storage.py: MySQLDatabaseAccess class receives as argument in initialisation a dict with connection options. --- diff --git a/ppf/new/storage.py b/ppf/new/storage.py index 68fd348..8cb9535 100644 --- a/ppf/new/storage.py +++ b/ppf/new/storage.py @@ -561,13 +561,16 @@ class SQLiteDatabaseAccess(DatabaseAccess): self.conn.commit() class MySQLDatabaseAccess(DatabaseAccess): - def __init___(self, database, user, password): + def __init___(self, database): super(MySQLDatabaseAccess, self).__init__(database) def connect(self): # TODO Add support for reading connection information from config_file - self.conn = MySQLdb.Connection(db=self.database, user="root", - passwd="p2p4th3m45535") + self.conn = MySQLdb.Connection(db=self.database['database'], + user=self.database['user'], + passwd=self.database['password'], + host=self.database['host'], + port=self.database['port']) self.cursor = self.conn.cursor() self.conn.commit()