From 11843fd9e1fc169e9b7a00da95e6328dceb85351 Mon Sep 17 00:00:00 2001 From: slaveofmoney Date: Mon, 3 Feb 2014 13:25:57 +0600 Subject: [PATCH] Removed double function declaration (get_uid) --- mining/DB_Mysql.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/mining/DB_Mysql.py b/mining/DB_Mysql.py index b25a0ea..16a0016 100644 --- a/mining/DB_Mysql.py +++ b/mining/DB_Mysql.py @@ -342,28 +342,13 @@ class DB_Mysql(): } return ret - def get_uid(self, id_or_username): - log.debug("Finding user id of %s", id_or_username) - uname = id_or_username.split(".", 1)[0] - self.execute("SELECT `id` FROM `accounts` where username = %s", (uname)) - row = self.dbc.fetchone() - - - if row is None: - return False - else: - uid = row[0] - return uid - - + def insert_worker(self, account_id, username, password): log.debug("Adding new worker %s", username) query = "INSERT INTO pool_worker" self.execute(query + '(account_id, username, password) VALUES (%s, %s, %s);', (account_id, username, password)) self.dbh.commit() return str(username) - - def close(self): self.dbh.close()