]> xmof Git - DeDRM.git/commitdiff
tools v5.5.2
authorApprentice Alf <apprenticealf@gmail.com>
Mon, 24 Dec 2012 23:31:34 +0000 (23:31 +0000)
committerApprentice Alf <apprenticealf@gmail.com>
Sat, 7 Mar 2015 13:58:52 +0000 (13:58 +0000)
Calibre_Plugins/K4MobiDeDRM_plugin/__init__.py
Calibre_Plugins/K4MobiDeDRM_plugin/getk4pcpids.py
Calibre_Plugins/k4mobidedrm_plugin.zip

index 539fa38394493098316bfe747f98e80d67f340d2..e5a1702a66384c89b97ff7fdbeb22df00649d383 100644 (file)
@@ -20,13 +20,14 @@ __docformat__ = 'restructuredtext en'
 #   0.4.9  - typo fix
 #   0.4.10 - Another Topaz Fix (class added to page and group and region)
 #   0.4.11 - Fixed Linux support of K4PC
+#   0.4.12 - More Linux Wine fixes
 
 """
 Decrypt Amazon Kindle and Mobipocket encrypted ebooks.
 """
 
 PLUGIN_NAME = u"Kindle and Mobipocket DeDRM"
-PLUGIN_VERSION_TUPLE = (0, 4, 11)
+PLUGIN_VERSION_TUPLE = (0, 4, 12)
 PLUGIN_VERSION = '.'.join([str(x) for x in PLUGIN_VERSION_TUPLE])
 
 import sys, os, re
index 138ab764bda831d263e451ab1a80a859ed2d64af..1614a534ffce3d02f082dbea8b1d03221354b7b4 100644 (file)
@@ -11,15 +11,21 @@ __version__ = '1.01'
 
 import sys
 
-class Unbuffered:
+class SafeUnbuffered:
     def __init__(self, stream):
         self.stream = stream
+        self.encoding = stream.encoding
+        if self.encoding == None:
+            self.encoding = "utf-8"
     def write(self, data):
+        if isinstance(data,unicode):
+            data = data.encode(self.encoding,"replace")
         self.stream.write(data)
         self.stream.flush()
     def __getattr__(self, attr):
         return getattr(self.stream, attr)
-sys.stdout=Unbuffered(sys.stdout)
+sys.stdout=SafeUnbuffered(sys.stdout)
+sys.stderr=SafeUnbuffered(sys.stderr)
 
 import os
 import struct
index add82b43694ad8e4b9fd6a22b8fed591c81a13be..9c00bfea26f49c6fceef326db423a46237d0bc45 100644 (file)
Binary files a/Calibre_Plugins/k4mobidedrm_plugin.zip and b/Calibre_Plugins/k4mobidedrm_plugin.zip differ