From 724156c554af01d96a2dde0589cae86d67ddafb6 Mon Sep 17 00:00:00 2001 From: Ciro Mattia Gonano Date: Fri, 12 Apr 2013 01:36:51 +0200 Subject: [PATCH] Small fixes --- kcc/comic2ebook.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 2c47d81..2338196 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- # # Copyright (c) 2012 Ciro Mattia Gonano # @@ -546,7 +547,7 @@ def slugify(value): and converts spaces to hyphens. """ import unicodedata - value = unicodedata.normalize('NFKD', unicode(value, 'UTF-8')).encode('ascii', 'ignore') + value = unicodedata.normalize('NFKD', unicode(value, 'latin1')).encode('ascii', 'ignore') value = re.sub('[^\w\s\.-]', '', value).strip().lower() value = re.sub('[-\.\s]+', '-', value) value = re.sub(r'([0-9]+)', r'00000\1', value) @@ -567,7 +568,6 @@ def sanitizeTree(filetree): if name.startswith('.'): os.remove(os.path.join(root, name)) else: - sanitizeTree(os.path.join(root, name)) os.rename(os.path.join(root, name), os.path.join(root, slugify(name))) @@ -578,7 +578,6 @@ def Copyright(): def Usage(): print "Generates HTML, NCX and OPF for a Comic ebook from a bunch of images." - print "Optimized for creating MOBI files to be read on Kindle Paperwhite." parser.print_help()