]> xmof Git - DeDRM.git/commitdiff
Merge fixes for new Kobo version and Linux support, update version number
authorapprenticeharper <apprenticeharper@gmail.com>
Mon, 11 Jan 2016 06:40:15 +0000 (06:40 +0000)
committerapprenticeharper <apprenticeharper@gmail.com>
Mon, 11 Jan 2016 06:40:15 +0000 (06:40 +0000)
Obok_calibre_plugin/obok_plugin.zip
Obok_calibre_plugin/obok_plugin/__init__.py
Obok_calibre_plugin/obok_plugin/obok/obok.py

index 2a53b4e0c5a028f336b781e248b3f5d2ef71d22c..c42dfb4d5ab251631b08fc3b36e2da56f8d3a6b2 100644 (file)
Binary files a/Obok_calibre_plugin/obok_plugin.zip and b/Obok_calibre_plugin/obok_plugin.zip differ
index 5a629f7bb7a7b56d2a900013c669a77a11582b81..730d38a4a79497d159195adb6f1e3ee7cd3ea247 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, 8)
+PLUGIN_VERSION_TUPLE = (6, 3, 5)
 PLUGIN_VERSION = '.'.join([str(x) for x in PLUGIN_VERSION_TUPLE])
 HELPFILE_NAME = PLUGIN_SAFE_NAME + '_Help.htm'
 PLUGIN_AUTHORS = 'Anon'
index 2c51643029b1fa388986d80e3b41eb0cfae55d00..26d1e38a1f0ab4c6a172e7b567c82deeac323530 100644 (file)
@@ -1,10 +1,13 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-# Version 3.1.9 December 2015
+# Version 6.3.5 January 2016
 # Update for latest version of Windows Desktop app.
 # Support Kobo devices in the command line version.
 #
+# Version 3.1.9 November 2015
+# Handle Kobo Desktop under wine on Linux
+#
 # Version 3.1.8 November 2015
 # Handle the case of Kobo Arc or Vox device (i.e. don't crash).
 #
@@ -338,6 +341,9 @@ class KoboLibrary(object):
                 self.kobodir = os.path.join(self.kobodir, u"Kobo", u"Kobo Desktop Edition")
             elif sys.platform.startswith('darwin'):
                 self.kobodir = os.path.join(os.environ['HOME'], u"Library", u"Application Support", u"Kobo", u"Kobo Desktop Edition")
+            elif linux_path != None:
+                # Probably Linux, let's get the wine prefix and path to Kobo.
+                self.kobodir = os.path.join(linux_path, u"Local Settings", u"Application Data", 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
@@ -413,6 +419,13 @@ class KoboLibrary(object):
             for m in matches:
                 # print u"m:{0}".format(m[0])
                 macaddrs.append(m[0].upper())
+        else:
+            # probably linux, let's try ipconfig under wine
+            c = re.compile('\s(' + '[0-9a-f]{2}-' * 5 + '[0-9a-f]{2})(\s|$)', re.IGNORECASE)
+            for line in os.popen('ipconfig /all'):
+                m = c.search(line)
+                if m:
+                    macaddrs.append(re.sub("-", ":", m.group(1)).upper())
 
         # extend the list of macaddrs in any case with the serials
         # cannot hurt ;-)