]> xmof Git - DeDRM.git/commitdiff
Fix for crash when Arc or Vox is connected.
authorapprenticeharper <apprenticeharper@gmail.com>
Thu, 29 Oct 2015 07:47:49 +0000 (07:47 +0000)
committerapprenticeharper <apprenticeharper@gmail.com>
Thu, 29 Oct 2015 07:47:49 +0000 (07:47 +0000)
Obok_calibre_plugin/obok_plugin.zip
Obok_calibre_plugin/obok_plugin/__init__.py
Obok_calibre_plugin/obok_plugin/action.py
Obok_calibre_plugin/obok_plugin/obok/obok.py
Obok_calibre_plugin/obok_plugin_ReadMe.txt

index 8f9010c04de9db6a69692a6bffe306e8969af068..2a53b4e0c5a028f336b781e248b3f5d2ef71d22c 100644 (file)
Binary files a/Obok_calibre_plugin/obok_plugin.zip and b/Obok_calibre_plugin/obok_plugin.zip differ
index 5a5eea049d4c3f516ec6123ffc9dd5ef7b1d0773..5a629f7bb7a7b56d2a900013c669a77a11582b81 100644 (file)
@@ -19,7 +19,7 @@ except NameError:
 PLUGIN_NAME = 'Obok DeDRM'
 PLUGIN_SAFE_NAME = PLUGIN_NAME.strip().lower().replace(' ', '_')
 PLUGIN_DESCRIPTION = _('Removes DRM from Kobo kepubs and adds them to the library.')
-PLUGIN_VERSION_TUPLE = (3, 1, 6)
+PLUGIN_VERSION_TUPLE = (3, 1, 8)
 PLUGIN_VERSION = '.'.join([str(x) for x in PLUGIN_VERSION_TUPLE])
 HELPFILE_NAME = PLUGIN_SAFE_NAME + '_Help.htm'
 PLUGIN_AUTHORS = 'Anon'
index cfa164dc8ccdd4df92ee40a155b8cd896f026dcf..2478abdd863099f0e7291c5ab8c134429892c349 100644 (file)
@@ -90,28 +90,29 @@ class InterfacePluginAction(InterfaceAction):
         #
         # search for connected device in case serials are saved
         tmpserials = cfg['kobo_serials']
-        device = self.parent().device_manager.connected_device
         device_path = None
-        if (device):
-            device_path = device._main_prefix
-            debug_print("get_device_settings - device_path=", device_path)
-            # get serial from device_path/.adobe-digital-editions/device.xml
-            if can_parse_xml:
-                devicexml = os.path.join(device_path, '.adobe-digital-editions', 'device.xml')
-                debug_print("trying to load %s" % devicexml)
-                if (os.path.exists(devicexml)):
-                    debug_print("trying to parse %s" % devicexml)
-                    xmltree = ET.parse(devicexml)
-                    for node in xmltree.iter():
-                        if "deviceSerial" in node.tag:
-                            serial = node.text
-                            debug_print ("found serial %s" % serial)
-                            tmpserials.append(serial)
-                            break
-
-
-        else:
-            debug_print("didn't find device")
+        try:
+            device = self.parent().device_manager.connected_device
+            if (device):
+                device_path = device._main_prefix
+                debug_print("get_device_settings - device_path=", device_path)
+                # get serial from device_path/.adobe-digital-editions/device.xml
+                if can_parse_xml:
+                    devicexml = os.path.join(device_path, '.adobe-digital-editions', 'device.xml')
+                    debug_print("trying to load %s" % devicexml)
+                    if (os.path.exists(devicexml)):
+                        debug_print("trying to parse %s" % devicexml)
+                        xmltree = ET.parse(devicexml)
+                        for node in xmltree.iter():
+                            if "deviceSerial" in node.tag:
+                                serial = node.text
+                                debug_print ("found serial %s" % serial)
+                                tmpserials.append(serial)
+                                break
+            else:
+                debug_print("didn't find device")
+        except:
+            debug_print("Exception getting device path. Probably not an E-Ink Kobo device")
 
         # Get the Kobo Library object (obok v3.01)
         self.library = KoboLibrary(tmpserials, device_path)
index 08f484a72fb025540cd11df2cd217a85d2baf718..7f4f31ec324d5bec0165e541828011e81f60aa13 100644 (file)
@@ -1,6 +1,9 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
+# Version 3.1.8 November 2015
+# Handle the case of Kobo Arc or Vox device (i.e. don't crash).
+#
 # Version 3.1.7 October 2015
 # Handle the case of no device or database more gracefully.
 #
index 3decbfbc03b58b5408e36af82bfe13560677cd79..db87dce107bc297e49d46b42cdfa63b14c07c67c 100644 (file)
@@ -1,7 +1,7 @@
 obok_plugin.zip
 ================
 
-This plugin will remove the DRM from Kobo ebooks download on Mac or Windows using the Kobo desktop application, or from Kobo ebooks on an attached Kobo reader. If both are available, ebooks will be read from the attached Kobo reader. To import from the desktop application, unplug the Kobo reader.
+This plugin will remove the DRM from Kobo ebooks download on Mac or Windows using the Kobo desktop application, or from Kobo ebooks on an attached E-Ink Kobo reader (but not a Kobo Arc or Kobo Vox). If both are available, ebooks will be read from the attached E-Ink Kobo reader. To import from the desktop application, unplug the Kobo reader.
 
 
 Installation