diff --git a/src/calibre/translations/calibre.pot b/src/calibre/translations/calibre.pot index 6a5f06661a..3042e4f2f4 100644 --- a/src/calibre/translations/calibre.pot +++ b/src/calibre/translations/calibre.pot @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: calibre 0.6.11\n" -"POT-Creation-Date: 2009-09-09 16:26+MDT\n" -"PO-Revision-Date: 2009-09-09 16:26+MDT\n" +"POT-Creation-Date: 2009-09-09 17:15+MDT\n" +"PO-Revision-Date: 2009-09-09 17:15+MDT\n" "Last-Translator: Automatically generated\n" "Language-Team: LANGUAGE\n" "MIME-Version: 1.0\n" diff --git a/src/calibre/utils/localization.py b/src/calibre/utils/localization.py index 115bb81e4c..308adf8cea 100644 --- a/src/calibre/utils/localization.py +++ b/src/calibre/utils/localization.py @@ -104,8 +104,11 @@ def get_language(lang): global _iso639 if lang in _extra_lang_codes: return _extra_lang_codes[lang] + ip = P('localization/iso639.pickle') + if not os.path.exists(ip): + return lang if _iso639 is None: - _iso639 = cPickle.load(open(P('localization/iso639.pickle'), 'rb')) + _iso639 = cPickle.load(open(ip, 'rb')) ans = lang lang = lang.split('_')[0].lower() if len(lang) == 2: diff --git a/src/calibre/web/feeds/recipes/recipe_the_new_republic.py b/src/calibre/web/feeds/recipes/recipe_the_new_republic.py new file mode 100644 index 0000000000..482dba1af0 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_the_new_republic.py @@ -0,0 +1,42 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class The_New_Republic(BasicNewsRecipe): + title = 'The New Republic' + __author__ = 'cix3' + language = 'en' + description = 'Intelligent, stimulating and rigorous examination of American politics, foreign policy and culture' + timefmt = ' [%b %d, %Y]' + + oldest_article = 7 + max_articles_per_feed = 100 + + remove_tags = [ + dict(name='div', attrs={'class':['print-logo', 'print-site_name', 'img-left', 'print-source_url']}), + dict(name='hr', attrs={'class':'print-hr'}), dict(name='img') + ] + + feeds = [ + ('Politics', 'http://www.tnr.com/rss/articles/Politics'), + ('Books and Arts', 'http://www.tnr.com/rss/articles/Books-and-Arts'), + ('Economy', 'http://www.tnr.com/rss/articles/Economy'), + ('Environment and Energy', 'http://www.tnr.com/rss/articles/Environment-%2526-Energy'), + ('Health Care', 'http://www.tnr.com/rss/articles/Health-Care'), + ('Urban Policy', 'http://www.tnr.com/rss/articles/Urban-Policy'), + ('World', 'http://www.tnr.com/rss/articles/World'), + ('Film', 'http://www.tnr.com/rss/articles/Film'), + ('Books', 'http://www.tnr.com/rss/articles/books'), + ('The Plank', 'http://www.tnr.com/rss/blogs/The-Plank'), + ('The Treatment', 'http://www.tnr.com/rss/blogs/The-Treatment'), + ('The Spine', 'http://www.tnr.com/rss/blogs/The-Spine'), + ('The Stash', 'http://www.tnr.com/rss/blogs/The-Stash'), + ('The Vine', 'http://www.tnr.com/rss/blogs/The-Vine'), + ('The Avenue', 'http://www.tnr.com/rss/blogs/The-Avenue'), + ('William Galston', 'http://www.tnr.com/rss/blogs/William-Galston'), + ('Simon Johnson', 'http://www.tnr.com/rss/blogs/Simon-Johnson'), + ('Ed Kilgore', 'http://www.tnr.com/rss/blogs/Ed-Kilgore'), + ('Damon Linker', 'http://www.tnr.com/rss/blogs/Damon-Linker'), + ('John McWhorter', 'http://www.tnr.com/rss/blogs/John-McWhorter') + ] + + def print_version(self, url): + return url.replace('http://www.tnr.com/', 'http://www.tnr.com/print/')