summaryrefslogtreecommitdiffstats
path: root/Code
diff options
context:
space:
mode:
authorKonrad Meier2011-11-14 13:37:50 +0100
committerKonrad Meier2011-11-14 13:37:50 +0100
commit9078cfa9bbee4390b13d6db818b397d084f645fb (patch)
treef94e43ee03148a720ffbdeefc43cea4f0a605f03 /Code
parentdatabase file without username and password including (diff)
downloadgsm-selftest-9078cfa9bbee4390b13d6db818b397d084f645fb.tar.gz
gsm-selftest-9078cfa9bbee4390b13d6db818b397d084f645fb.tar.xz
gsm-selftest-9078cfa9bbee4390b13d6db818b397d084f645fb.zip
Merged the required login credentials for the database from differnt files to a central place.
Diffstat (limited to 'Code')
-rwxr-xr-xCode/Server-Code/DbClass.py10
-rwxr-xr-xCode/Server-Code/gsmselftest.py2
-rwxr-xr-xCode/Server-Code/initTestClass.py2
-rwxr-xr-xCode/Server-Code/truthtableClass.py2
-rwxr-xr-xCode/Server-Code/usbDetectClass.py2
5 files changed, 9 insertions, 9 deletions
diff --git a/Code/Server-Code/DbClass.py b/Code/Server-Code/DbClass.py
index cc3a083..fb6b253 100755
--- a/Code/Server-Code/DbClass.py
+++ b/Code/Server-Code/DbClass.py
@@ -2,12 +2,12 @@ import MySQLdb
import string
class DBMySQLConnection:
- def __init__(self, username, password, host, dbname):
+ def __init__(self):
#initialize at the start all the user parameters
- self.usern = username
- self.passw = password
- self.host = host
- self.db = dbname
+ self.usern = "selftest"
+ self.passw = "selftest"
+ self.host = "localhost"
+ self.db = "gsmselftesting"
self.connectionCreated = 0
self.tasksList = list()
self.callerLists = list()
diff --git a/Code/Server-Code/gsmselftest.py b/Code/Server-Code/gsmselftest.py
index 0ebc1b6..f6be5a2 100755
--- a/Code/Server-Code/gsmselftest.py
+++ b/Code/Server-Code/gsmselftest.py
@@ -72,7 +72,7 @@ def initDB(): # function for connection database
global dbStatus
global db
if dbStatus != 1:
- db = DbClass.DBMySQLConnection('root', 'randompasswordSQL', 'localhost', 'gsmselftesting')
+ db = DbClass.DBMySQLConnection()
db.connectDB()
dbStatus = db.connectDB()
if dbStatus == 1:
diff --git a/Code/Server-Code/initTestClass.py b/Code/Server-Code/initTestClass.py
index 8b854a7..d15be97 100755
--- a/Code/Server-Code/initTestClass.py
+++ b/Code/Server-Code/initTestClass.py
@@ -20,7 +20,7 @@ class initTesting:
def initDB(self):
- self.db = DbClass.DBMySQLConnection('root', 'randompasswordSQL', 'localhost', 'gsmselftesting')
+ self.db = DbClass.DBMySQLConnection()
self.db.connectDB()
self.dbStatus = self.db.connectDB()
diff --git a/Code/Server-Code/truthtableClass.py b/Code/Server-Code/truthtableClass.py
index e2fff55..bf57ca6 100755
--- a/Code/Server-Code/truthtableClass.py
+++ b/Code/Server-Code/truthtableClass.py
@@ -12,7 +12,7 @@ class trueTable:
def initDB(self):
# function for connect to database
- self.db = DbClass.DBMySQLConnection('root', 'randompasswordSQL', 'localhost', 'gsmselftesting')
+ self.db = DbClass.DBMySQLConnection()
self.db.connectDB()
self.dbStatus = self.db.connectDB()
diff --git a/Code/Server-Code/usbDetectClass.py b/Code/Server-Code/usbDetectClass.py
index 13aebfd..d64e328 100755
--- a/Code/Server-Code/usbDetectClass.py
+++ b/Code/Server-Code/usbDetectClass.py
@@ -14,7 +14,7 @@ class serialPort:
#self.updateStatus = None
def initDB(self):
- self.db = DbClass.DBMySQLConnection('root', 'randompasswordSQL', 'localhost', 'gsmselftesting')
+ self.db = DbClass.DBMySQLConnection()
self.db.connectDB()
self.dbStatus = self.db.connectDB()