Change default value handling in dbtools
This commit is contained in:
parent
1a31e34558
commit
e9c6290b69
1 changed files with 3 additions and 3 deletions
|
@ -27,13 +27,13 @@ class dbObject:
|
||||||
self.dbtype = SQLITE
|
self.dbtype = SQLITE
|
||||||
self.path = path
|
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:
|
if dbtype == SQLITE:
|
||||||
self.initSQLite(path)
|
self.initSQLite(path or 'Database.db')
|
||||||
|
|
||||||
elif dbtype == MYSQL:
|
elif dbtype == MYSQL:
|
||||||
self.initMySQL(host, port or 3306, user, pwd, db)
|
self.initMySQL(host or 'localhost', port or 3306, user, pwd, db)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("Unknown database type %s." % str(dbtype))
|
raise ValueError("Unknown database type %s." % str(dbtype))
|
||||||
|
|
Loading…
Reference in a new issue