mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2024-12-24 18:24:34 +06:00
obok: make sure that file exists before opening the db
This commit is contained in:
parent
00a5c4e1d1
commit
0c67fd43a2
@ -260,7 +260,7 @@ class KoboLibrary(object):
|
|||||||
self.kobodir = os.path.join(device_path, u".kobo")
|
self.kobodir = os.path.join(device_path, u".kobo")
|
||||||
# devices use KoboReader.sqlite
|
# devices use KoboReader.sqlite
|
||||||
kobodb = os.path.join(self.kobodir, u"KoboReader.sqlite")
|
kobodb = os.path.join(self.kobodir, u"KoboReader.sqlite")
|
||||||
if (not(os.path.exists(kobodb))):
|
if (not(os.path.isfile(kobodb))):
|
||||||
# give up here, we haven't found anything useful
|
# give up here, we haven't found anything useful
|
||||||
self.kobodir = u""
|
self.kobodir = u""
|
||||||
kobodb = u""
|
kobodb = u""
|
||||||
@ -282,6 +282,12 @@ class KoboLibrary(object):
|
|||||||
self.kobodir = os.path.join(os.environ['HOME'], u"Library", u"Application Support", u"Kobo", u"Kobo Desktop Edition")
|
self.kobodir = os.path.join(os.environ['HOME'], u"Library", u"Application Support", u"Kobo", u"Kobo Desktop Edition")
|
||||||
# desktop versions use Kobo.sqlite
|
# desktop versions use Kobo.sqlite
|
||||||
kobodb = os.path.join(self.kobodir, u"Kobo.sqlite")
|
kobodb = os.path.join(self.kobodir, u"Kobo.sqlite")
|
||||||
|
# check for existence of file
|
||||||
|
if (not(os.path.isfile(kobodb))):
|
||||||
|
# give up here, we haven't found anything useful
|
||||||
|
self.kobodir = u""
|
||||||
|
kobodb = u""
|
||||||
|
|
||||||
|
|
||||||
if (self.kobodir != u""):
|
if (self.kobodir != u""):
|
||||||
self.bookdir = os.path.join(self.kobodir, u"kepub")
|
self.bookdir = os.path.join(self.kobodir, u"kepub")
|
||||||
|
Loading…
Reference in New Issue
Block a user