From 9b7053cda108a29ab497a2a6dfddfb6fcd780925 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 30 Jul 2010 11:01:58 -0600 Subject: [PATCH] Kobo driver: Show a warning when the user tries to export/view .kobo files --- src/calibre/devices/kobo/driver.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index f4c4cad3c7..87aa47e588 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -235,7 +235,7 @@ class KOBO(USBMS): else: # if extension == '.html' or extension == '.txt': ContentType = 999 # Yet another hack: to get around Kobo changing how ContentID is stored ContentID = self.contentid_from_path(path, ContentType) - + ImageID = self.delete_via_sql(ContentID, ContentType) #print " We would now delete the Images for" + ImageID self.delete_images(ImageID) @@ -355,3 +355,16 @@ class KOBO(USBMS): # print "Internal: " + filename return path + + def get_file(self, path, *args, **kwargs): + tpath = self.munge_path(path) + extension = os.path.splitext(tpath)[1] + if extension == '.kobo': + from calibre.devices.errors import UserFeedback + raise UserFeedback(_("Not Implemented"), + _('".kobo" files do not exist on the device but are rows in the sqlitedatabase. ' + 'Currently they cannot be exported or viewed.'), + UserFeedback.WARN) + + return USBMS.get_file(self, path, *args, **kwargs) +