]> xmof Git - DeDRM.git/commitdiff
More changes to the obok cli interface for character encodings
authorapprenticeharper <apprenticeharper@gmail.com>
Tue, 8 Sep 2015 06:52:06 +0000 (07:52 +0100)
committerapprenticeharper <apprenticeharper@gmail.com>
Tue, 8 Sep 2015 06:52:06 +0000 (07:52 +0100)
Obok_calibre_plugin/obok_plugin.zip
Obok_calibre_plugin/obok_plugin/obok/obok.py
Other_Tools/Kobo/obok.py

index 144ad0e8d130a67ba4498de81a8407afbd145599..3e1b918528975c691398c6c3339748fe7af4e948 100644 (file)
Binary files a/Obok_calibre_plugin/obok_plugin.zip and b/Obok_calibre_plugin/obok_plugin.zip differ
index d619a26ae53af02bb11ac39674e115c4b2cb08d4..18e629bccef21148db2e7ea9c0aa8a339b20d93b 100644 (file)
@@ -486,7 +486,7 @@ def cli_main():
     lib = KoboLibrary()
 
     for i, book in enumerate(lib.books):
-        print ('%d: %s' % (i + 1, book.title)).encode('ascii', 'ignore')
+        print ('%d: %s' % (i + 1, book.title))
 
     num_string = raw_input("Convert book number... ")
     try:
@@ -499,7 +499,7 @@ def cli_main():
 
     zin = zipfile.ZipFile(book.filename, "r")
     # make filename out of Unicode alphanumeric and whitespace equivalents from title
-    outname = "%s.epub" % (re.sub('[^\s\w]', '', book.title, 0, re.UNICODE))
+    outname = "%s.epub" % (re.sub('[^\s\w]', '_', book.title, 0, re.UNICODE))
 
     if (book.type == 'drm-free'):
         print "DRM-free book, conversion is not needed"
index d619a26ae53af02bb11ac39674e115c4b2cb08d4..18e629bccef21148db2e7ea9c0aa8a339b20d93b 100644 (file)
@@ -486,7 +486,7 @@ def cli_main():
     lib = KoboLibrary()
 
     for i, book in enumerate(lib.books):
-        print ('%d: %s' % (i + 1, book.title)).encode('ascii', 'ignore')
+        print ('%d: %s' % (i + 1, book.title))
 
     num_string = raw_input("Convert book number... ")
     try:
@@ -499,7 +499,7 @@ def cli_main():
 
     zin = zipfile.ZipFile(book.filename, "r")
     # make filename out of Unicode alphanumeric and whitespace equivalents from title
-    outname = "%s.epub" % (re.sub('[^\s\w]', '', book.title, 0, re.UNICODE))
+    outname = "%s.epub" % (re.sub('[^\s\w]', '_', book.title, 0, re.UNICODE))
 
     if (book.type == 'drm-free'):
         print "DRM-free book, conversion is not needed"