Change default value handling in dbtools

This commit is contained in:
Klaus-Uwe Mitterer 2016-05-20 21:39:21 +02:00
parent e751e85276
commit 7e9e27e00b

View file

@ -27,13 +27,13 @@ class dbObject:
self.dbtype = SQLITE
self.path = path
def __init__(self, dbtype = SQLITE, path = 'Database.db', host = None, port = None, user = None, pwd = None, db = None):
def __init__(self, dbtype = SQLITE, path = None, host = None, port = None, user = None, pwd = None, db = None):
if dbtype == SQLITE:
self.initSQLite(path)
self.initSQLite(path or 'Database.db')
elif dbtype == MYSQL:
self.initMySQL(host, port or 3306, user, pwd, db)
self.initMySQL(host or 'localhost', port or 3306, user, pwd, db)
else:
raise ValueError("Unknown database type %s." % str(dbtype))