From e35acbf1047b236e58a8a71a861269bb30611a80 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 May 2009 08:59:38 -0700 Subject: [PATCH] Fix title of Sueddeutsche recipe and fix generation of MAN pages in unicode environments --- src/calibre/utils/help2man.py | 17 ++++++++++------- .../web/feeds/recipes/recipe_sueddeutsche.py | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/calibre/utils/help2man.py b/src/calibre/utils/help2man.py index 9777ea24cd..173d760864 100644 --- a/src/calibre/utils/help2man.py +++ b/src/calibre/utils/help2man.py @@ -16,7 +16,7 @@ def create_man_page(prog, parser): else: usage[i] = line.replace('%prog', prog) lines = [ - '.TH ' + prog.upper() + ' "1" ' + time.strftime('"%B %Y"') + + '.TH ' + prog.upper() + ' "1" ' + time.strftime('"%B %Y"') + ' "%s (%s %s)" "%s"'%(prog, __appname__, __version__, __appname__), '.SH NAME', prog + r' \- part of '+__appname__, @@ -25,7 +25,7 @@ def create_man_page(prog, parser): '.SH DESCRIPTION', ] lines += usage[1:] - + lines += [ '.SH OPTIONS' ] @@ -39,7 +39,7 @@ def create_man_page(prog, parser): help = opt.help if opt.help else '' ans.append(help.replace('%prog', prog).replace('%default', str(opt.default))) return ans - + for opt in parser.option_list: lines.extend(format_option(opt)) for group in parser.option_groups: @@ -48,12 +48,15 @@ def create_man_page(prog, parser): lines.extend(['.PP', group.description]) for opt in group.option_list: lines.extend(format_option(opt)) - - lines += ['.SH SEE ALSO', + + lines += ['.SH SEE ALSO', 'The User Manual is available at ' 'http://calibre.kovidgoyal.net/user_manual', '.PP', '.B Created by '+__author__] - - return bz2.compress('\n'.join(lines)) + + lines = [x if isinstance(x, unicode) else unicode(x, 'utf-8', 'replace') for + x in lines] + + return bz2.compress((u'\n'.join(lines)).encode('utf-8')) diff --git a/src/calibre/web/feeds/recipes/recipe_sueddeutsche.py b/src/calibre/web/feeds/recipes/recipe_sueddeutsche.py index ab84f0b1a5..ae2cb86cfa 100644 --- a/src/calibre/web/feeds/recipes/recipe_sueddeutsche.py +++ b/src/calibre/web/feeds/recipes/recipe_sueddeutsche.py @@ -9,7 +9,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class Sueddeutsche(BasicNewsRecipe): - title = u'S\xc3\xbcddeutsche' + title = u'S\xfcddeutsche' description = 'News from Germany' __author__ = 'Oliver Niesner' use_embedded_content = False