diff --git a/installer/osx/py2app/main.py b/installer/osx/py2app/main.py index 67980053a8..fb00b4dd9b 100644 --- a/installer/osx/py2app/main.py +++ b/installer/osx/py2app/main.py @@ -272,6 +272,9 @@ class Py2App(object): for f in glob.glob('src/calibre/plugins/*.so'): shutil.copy2(f, dest) self.fix_dependencies_in_lib(join(dest, basename(f))) + if 'podofo' in f: + self.change_dep('libpodofo.0.6.99.dylib', + self.FID+'/'+'libpodofo.0.6.99.dylib', join(dest, basename(f))) @flush @@ -374,7 +377,7 @@ class Py2App(object): @flush def add_misc_libraries(self): - for x in ('usb', 'unrar'): + for x in ('usb', 'unrar', 'readline.6.0'): print '\nAdding', x x = 'lib%s.dylib'%x shutil.copy2(join(SW, 'lib', x), self.frameworks_dir) diff --git a/src/calibre/gui2/convert/txt_output.py b/src/calibre/gui2/convert/txt_output.py index c2474ac4b8..eca85f1292 100644 --- a/src/calibre/gui2/convert/txt_output.py +++ b/src/calibre/gui2/convert/txt_output.py @@ -6,7 +6,7 @@ __docformat__ = 'restructuredtext en' from calibre.gui2.convert.txt_output_ui import Ui_Form from calibre.gui2.convert import Widget -from calibre.ebooks.txt.writer import TxtNewlines +from calibre.ebooks.txt.newlines import TxtNewlines from calibre.gui2.widgets import BasicComboModel newline_model = None diff --git a/src/calibre/web/feeds/recipes/recipe_latimes.py b/src/calibre/web/feeds/recipes/recipe_latimes.py index 915a0946df..424cdca32c 100644 --- a/src/calibre/web/feeds/recipes/recipe_latimes.py +++ b/src/calibre/web/feeds/recipes/recipe_latimes.py @@ -1,7 +1,7 @@ #!/usr/bin/env python __license__ = 'GPL v3' -__copyright__ = '2008, Darko Miletic ' +__copyright__ = '2008-2009, Darko Miletic ' ''' latimes.com ''' @@ -14,16 +14,22 @@ class LATimes(BasicNewsRecipe): description = u'News from Los Angeles' oldest_article = 7 max_articles_per_feed = 100 - language = _('English') + language = _('English') no_stylesheets = True use_embedded_content = False + encoding = 'utf-8' + lang = 'en-US' - keep_only_tags = [ dict(name='div', attrs={'id':'center' }) ] - remove_tags_after = [ dict(name='div', attrs={'id':'socialnet'}) ] - remove_tags = [ - dict(name='div' , attrs={'id':'wrapper_vid' }) - ,dict(name='div' , attrs={'id':'article_related'}) - ,dict(name='div' , attrs={'id':'socialnet' }) - ] + conversion_options = { + 'comment' : description + , 'language' : lang + } + + keep_only_tags = [dict(name='div', attrs={'class':'story' })] + remove_tags_after = [dict(name='div', attrs={'id':'story-body' })] + remove_tags = [dict(name='div', attrs={'class':['thumbnail','articlerail','tools']})] - feeds = [(u'News', u'http://feeds.latimes.com/latimes/news')] \ No newline at end of file + feeds = [(u'News', u'http://feeds.latimes.com/latimes/news')] + + def get_article_url(self, article): + return article.get('feedburner_origlink') diff --git a/src/calibre/web/feeds/recipes/recipe_the_budget_fashionista.py b/src/calibre/web/feeds/recipes/recipe_the_budget_fashionista.py index 113cf9ce43..802b5da287 100644 --- a/src/calibre/web/feeds/recipes/recipe_the_budget_fashionista.py +++ b/src/calibre/web/feeds/recipes/recipe_the_budget_fashionista.py @@ -6,9 +6,7 @@ __copyright__ = '2009, Darko Miletic ' www.thebudgetfashionista.com ''' -import re from calibre.web.feeds.recipes import BasicNewsRecipe -from calibre.ebooks.BeautifulSoup import Tag class TheBudgetFashionista(BasicNewsRecipe): title = 'The Budget Fashionista' @@ -24,40 +22,22 @@ class TheBudgetFashionista(BasicNewsRecipe): lang = 'en-US' language = _('English') - preprocess_regexps = [(re.compile(r"{0,1}", re.DOTALL|re.IGNORECASE),lambda match: '')] + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : lang + } - html2lrf_options = [ - '--comment', description - , '--category', category - , '--publisher', publisher - ] - - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' - - keep_only_tags = [dict(name='div', attrs={'id':'singlepost'})] - remove_tags_after = dict(name='div', attrs={'id':'postnav'}) - remove_tags = [ - dict(name=['object','link','script','iframe','form']) - ,dict(name='div', attrs={'id':'postnav'}) - ] + keep_only_tags = [dict(name='div', attrs={'class':'columnLeft'})] + remove_tags_after = dict(name='div', attrs={'class':'postDetails'}) + remove_tags = [dict(name=['object','link','script','iframe','form','login-button'])] feeds = [(u'Articles', u'http://www.thebudgetfashionista.com/feeds/atom/')] def preprocess_html(self, soup): - for item in soup.findAll(style=True): - del item['style'] - return soup + for it in soup.findAll('img'): + if it.parent.name == 'a': + it.parent.name = 'div' + return soup; - def postprocess_html(self, soup, x): - body = soup.find('body') - post = soup.find('div', attrs={'id':'singlepost'}) - if post and body: - post.extract() - body.extract() - soup.html.append(body) - body.insert(1,post) - mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) - mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) - soup.head.insert(0,mlang) - soup.head.insert(1,mcharset) - return self.adeify_images(soup)