From a5197a6abb010e92f9b0fbd8edae0a1793734c29 Mon Sep 17 00:00:00 2001 From: seph Date: Fri, 4 Mar 2016 22:27:57 -0500 Subject: [PATCH] Fix an error message, and add another --- .../DeDRM.app/Contents/Resources/mobidedrm.py | 4 +++- .../DeDRM_App/DeDRM_lib/lib/mobidedrm.py | 4 +++- DeDRM_calibre_plugin/DeDRM_plugin/mobidedrm.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/mobidedrm.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/mobidedrm.py index 89cc695..67e9355 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/mobidedrm.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/mobidedrm.py @@ -448,6 +448,8 @@ class MobiBook: goodpids.append(pid[0:-2]) elif len(pid)==8: goodpids.append(pid) + else: + print u"Warning: PID {0} has wrong number of digits".format(pid) if self.crypto_type == 1: t1_keyvec = 'QDCVEPMU675RUBSZ' @@ -530,7 +532,7 @@ def cli_main(): stripped_file = getUnencryptedBook(infile, pidlist) file(outfile, 'wb').write(stripped_file) except DrmException, e: - print u"MobiDeDRM v{0} Error: {0:s}".format(__version__,e.args[0]) + print u"MobiDeDRM v{0} Error: {1:s}".format(__version__,e.args[0]) return 1 return 0 diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/mobidedrm.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/mobidedrm.py index 89cc695..67e9355 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/mobidedrm.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/mobidedrm.py @@ -448,6 +448,8 @@ class MobiBook: goodpids.append(pid[0:-2]) elif len(pid)==8: goodpids.append(pid) + else: + print u"Warning: PID {0} has wrong number of digits".format(pid) if self.crypto_type == 1: t1_keyvec = 'QDCVEPMU675RUBSZ' @@ -530,7 +532,7 @@ def cli_main(): stripped_file = getUnencryptedBook(infile, pidlist) file(outfile, 'wb').write(stripped_file) except DrmException, e: - print u"MobiDeDRM v{0} Error: {0:s}".format(__version__,e.args[0]) + print u"MobiDeDRM v{0} Error: {1:s}".format(__version__,e.args[0]) return 1 return 0 diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/mobidedrm.py b/DeDRM_calibre_plugin/DeDRM_plugin/mobidedrm.py index 89cc695..67e9355 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/mobidedrm.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/mobidedrm.py @@ -448,6 +448,8 @@ class MobiBook: goodpids.append(pid[0:-2]) elif len(pid)==8: goodpids.append(pid) + else: + print u"Warning: PID {0} has wrong number of digits".format(pid) if self.crypto_type == 1: t1_keyvec = 'QDCVEPMU675RUBSZ' @@ -530,7 +532,7 @@ def cli_main(): stripped_file = getUnencryptedBook(infile, pidlist) file(outfile, 'wb').write(stripped_file) except DrmException, e: - print u"MobiDeDRM v{0} Error: {0:s}".format(__version__,e.args[0]) + print u"MobiDeDRM v{0} Error: {1:s}".format(__version__,e.args[0]) return 1 return 0