From edfb376516acd3b58097cf21571a3af9a0957a1c Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sun, 8 May 2011 09:51:46 +0100 Subject: [PATCH 1/3] Change titlecase to use 'Mac' processing only when language is a variant of English --- src/calibre/utils/titlecase.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/calibre/utils/titlecase.py b/src/calibre/utils/titlecase.py index 1f153dd5fe..285f55f22d 100755 --- a/src/calibre/utils/titlecase.py +++ b/src/calibre/utils/titlecase.py @@ -10,6 +10,7 @@ License: http://www.opensource.org/licenses/mit-license.php import re from calibre.utils.icu import capitalize +from calibre.utils.config import prefs __all__ = ['titlecase'] __version__ = '0.5' @@ -67,11 +68,12 @@ def titlecase(text): line.append(icu_lower(word)) continue - match = MAC_MC.match(word) - if match and not match.group(2)[:3] in ('hin', 'ht'): - line.append("%s%s" % (capitalize(match.group(1)), - capitalize(match.group(2)))) - continue + if prefs['language'].startswith('en'): + match = MAC_MC.match(word) + if match and not match.group(2)[:3] in ('hin', 'ht'): + line.append("%s%s" % (capitalize(match.group(1)), + capitalize(match.group(2)))) + continue hyphenated = [] for item in word.split('-'): From c49c187cb6341ac62d2fa0cad28b48c0b4a69bc7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 May 2011 09:12:55 -0600 Subject: [PATCH 2/3] Fix #779322 (ebook-convert can't output to "../filename.epub") --- src/calibre/ebooks/conversion/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/conversion/cli.py b/src/calibre/ebooks/conversion/cli.py index f1d5d5fe1b..b03887469d 100644 --- a/src/calibre/ebooks/conversion/cli.py +++ b/src/calibre/ebooks/conversion/cli.py @@ -68,7 +68,8 @@ def check_command_line_options(parser, args, log): raise SystemExit(1) output = args[2] - if output.startswith('.') and output != '.': + if output.startswith('.') and (output != '.' and not + output.startswith('..')): output = os.path.splitext(os.path.basename(input))[0]+output output = os.path.abspath(output) From 81a501604128274d364c651ec7b37c3499fbd2d2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 May 2011 09:36:46 -0600 Subject: [PATCH 3/3] Updated recipes for Fronda and Rzeczpospolita --- recipes/fronda.recipe | 17 +++++++++++------ recipes/icons/rzeczpospolita.png | Bin 0 -> 1195 bytes recipes/rzeczpospolita.recipe | 11 ++++++++++- 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 recipes/icons/rzeczpospolita.png diff --git a/recipes/fronda.recipe b/recipes/fronda.recipe index f57c7ecccb..452dca9068 100644 --- a/recipes/fronda.recipe +++ b/recipes/fronda.recipe @@ -21,14 +21,19 @@ class Fronda(BasicNewsRecipe): feeds = [(u'Infformacje', u'http://fronda.pl/news/feed')] - keep_only_tags = [dict(name='h1', attrs={'class':'big'}), - dict(name='ul', attrs={'class':'about clear'}), - dict(name='div', attrs={'class':'content'})] + keep_only_tags = [dict(name='h2', attrs={'class':'news_title'}), + dict(name='div', attrs={'class':'naglowek_tresc'}), + dict(name='div', attrs={'id':'czytaj'}) ] + + remove_tags = [dict(name='a', attrs={'class':'print'})] + preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in - [ (r'Drukuj', lambda match: ''), - (r'

.*

', lambda match: ''), + [ (r'

.*

', lambda match: ''), (r'

.*

', lambda match: ''), (r'

W.* lektury.*

', lambda match: ''), - (r'

Zobacz t.*?', lambda match: '') ] + (r'

Zobacz t.*?', lambda match: ''), + (r']*> 

', lambda match: ''), + (r'


', lambda match: ''), + (r'