From 378aff4f35ab489cc3f1022b33d033452cce6bb3 Mon Sep 17 00:00:00 2001 From: Ciro Mattia Gonano Date: Thu, 7 Mar 2013 11:21:17 +0100 Subject: [PATCH] Gracefully exit if unrar missing (#15) --- kcc/comic2ebook.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 196f132..7cb4108 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -399,7 +399,11 @@ def getWorkFolder(afile): else: cbx = cbxarchive.CBxArchive(afile) if cbx.isCbxFile(): - path = cbx.extract(workdir) + try: + path = cbx.extract(workdir) + except OSError: + print 'Unrar not found, please download from http://www.rarlab.com/download.htm and put into your PATH.' + sys.exit(21) else: raise TypeError move(path, path + "_temp")