Fixes #55
fall back to CDServer.sqlite if cdclient.sqlite doesn't exist
This commit is contained in:
parent
e69d25594a
commit
ba157a3715
@ -191,9 +191,18 @@ def get_cdclient():
|
|||||||
"""
|
"""
|
||||||
cdclient = getattr(g, '_cdclient', None)
|
cdclient = getattr(g, '_cdclient', None)
|
||||||
if cdclient is None:
|
if cdclient is None:
|
||||||
|
path = pathlib.Path('app/luclient/res/cdclient.sqlite')
|
||||||
|
if path.is_file():
|
||||||
cdclient = g._database = sqlite3.connect('app/luclient/res/cdclient.sqlite')
|
cdclient = g._database = sqlite3.connect('app/luclient/res/cdclient.sqlite')
|
||||||
return cdclient
|
return cdclient
|
||||||
|
|
||||||
|
path = pathlib.Path('app/luclient/res/CDServer.sqlite')
|
||||||
|
if path.is_file():
|
||||||
|
cdclient = g._database = sqlite3.connect('app/luclient/res/CDServer.sqlite')
|
||||||
|
return cdclient
|
||||||
|
|
||||||
|
return cdclient
|
||||||
|
|
||||||
|
|
||||||
def query_cdclient(query, args=(), one=False):
|
def query_cdclient(query, args=(), one=False):
|
||||||
"""Run sql queries on CDClient
|
"""Run sql queries on CDClient
|
||||||
|
Loading…
Reference in New Issue
Block a user