forked from darklegion/tremulous-master
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdb.py
More file actions
20 lines (19 loc) · 744 Bytes
/
db.py
File metadata and controls
20 lines (19 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
def dbconnect(id):
if id == 'auto':
try:
from logsqlite import log_client, log_gamestat, db_id
except ImportError:
from logtdb import log_client, log_gamestat, db_id
elif id == 'sqlite':
from logsqlite import log_client, log_gamestat, db_id
elif id == 'tdb':
from logtdb import log_client, log_gamestat, db_id
elif id == 'none':
def disabled_db(*args):
'''This function is defined and used when the database is disabled
by configuration options'''
log_client = log_gamestat = disabled_db
db_id = 'Not using a database'
else:
assert False, 'unhandled config.db option'
return log_client, log_gamestat, db_id