summaryrefslogtreecommitdiffstats
path: root/Other_Tools
diff options
context:
space:
mode:
authorapprenticeharper <[email protected]>2015-10-13 08:05:34 +0100
committerapprenticeharper <[email protected]>2015-10-13 08:05:34 +0100
commit9434751a721b229ade364a436e514f6c145cd2a8 (patch)
treee8f24e5c7e95655b401d3680f33a3d02c3125a5e /Other_Tools
parentfc156852a4d1d93fee8322d72ecd77a0a6eb51a6 (diff)
updated version number and script copy for obok changes
Diffstat (limited to 'Other_Tools')
-rw-r--r--Other_Tools/Kobo/obok.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Other_Tools/Kobo/obok.py b/Other_Tools/Kobo/obok.py
index 04b9075..08f484a 100644
--- a/Other_Tools/Kobo/obok.py
+++ b/Other_Tools/Kobo/obok.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+# Version 3.1.7 October 2015
+# Handle the case of no device or database more gracefully.
+#
# Version 3.1.6 September 2015
# Enable support for Kobo devices
# More character encoding fixes (unicode strings)
@@ -123,7 +126,7 @@
#
"""Manage all Kobo books, either encrypted or DRM-free."""
-__version__ = '3.1.6'
+__version__ = '3.1.7'
import sys
import os
@@ -260,7 +263,7 @@ class KoboLibrary(object):
self.kobodir = os.path.join(device_path, u".kobo")
# devices use 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
self.kobodir = u""
kobodb = u""
@@ -282,6 +285,12 @@ class KoboLibrary(object):
self.kobodir = os.path.join(os.environ['HOME'], u"Library", u"Application Support", u"Kobo", u"Kobo Desktop Edition")
# desktop versions use 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""):
self.bookdir = os.path.join(self.kobodir, u"kepub")