diff --git a/setup.py b/setup.py index 9da4647858..2f0c5aad26 100644 --- a/setup.py +++ b/setup.py @@ -415,8 +415,9 @@ if __name__ == '__main__': ext_modules.append(Extension('calibre.plugins.winutil', sources=['src/calibre/utils/windows/winutil.c'], libraries=['shell32', 'setupapi'], - include_dirs=['C:/WinDDK/6001.18001/inc/api/', - 'C:/WinDDK/6001.18001/inc/crt/'], + include_dirs=os.environ.get('INCLUDE', + 'C:/WinDDK/6001.18001/inc/api/;' + 'C:/WinDDK/6001.18001/inc/crt/').split(';'), extra_compile_args=['/X'] )) if isosx: diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 83624d6b5d..2ed41ac898 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -267,6 +267,12 @@ class MobiReader(object): 'xx-large' : '6', } for tag in root.iter(etree.Element): + if tag.tag in ('country-region', 'place', 'placetype', 'placename', + 'state', 'city'): + tag.tag = 'span' + for key in tag.attrib.keys(): + tag.attrib.pop(key) + continue styles, attrib = [], tag.attrib if attrib.has_key('style'): style = attrib.pop('style').strip() diff --git a/src/calibre/gui2/images/news/infobae.png b/src/calibre/gui2/images/news/infobae.png new file mode 100644 index 0000000000..6a25d93325 Binary files /dev/null and b/src/calibre/gui2/images/news/infobae.png differ diff --git a/src/calibre/gui2/images/news/pagina12.png b/src/calibre/gui2/images/news/pagina12.png new file mode 100644 index 0000000000..e6384e8ad9 Binary files /dev/null and b/src/calibre/gui2/images/news/pagina12.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index faeb65c193..8b0165b184 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -22,7 +22,7 @@ recipe_modules = ['recipe_' + r for r in ( 'time_magazine', 'endgadget', 'fudzilla', 'nspm_int', 'nspm', 'pescanik', 'spiegel_int', 'themarketticker', 'tomshardware', 'xkcd', 'ftd', 'zdnet', 'joelonsoftware', 'telepolis', 'common_dreams', 'nin', 'tomshardware_de', - + 'pagina12', 'infobae', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_clarin.py b/src/calibre/web/feeds/recipes/recipe_clarin.py index 7dda99a08d..1840be291f 100644 --- a/src/calibre/web/feeds/recipes/recipe_clarin.py +++ b/src/calibre/web/feeds/recipes/recipe_clarin.py @@ -6,7 +6,7 @@ __copyright__ = '2008, Darko Miletic ' clarin.com ''' -from calibre.web.feeds.news import BasicNewsRecipe +from calibre import strftime class Clarin(BasicNewsRecipe): title = 'Clarin' @@ -15,7 +15,9 @@ class Clarin(BasicNewsRecipe): oldest_article = 2 max_articles_per_feed = 100 use_embedded_content = False - cover_url = 'http://www.clarin.com/shared/v10/img/Hd/lg_Clarin.gif' + no_stylesheets = True + cover_url = strftime('http://www.clarin.com/diario/%Y/%m/%d/portada.jpg') + html2lrf_options = [ '--comment', description , '--base-font-size', '10' @@ -44,4 +46,5 @@ class Clarin(BasicNewsRecipe): artl = article.get('link', None) rest = artl.partition('-0')[-1] lmain = rest.partition('.')[0] - return 'http://www.servicios.clarin.com/notas/jsp/clarin/v9/notas/imprimir.jsp?pagid=' + lmain \ No newline at end of file + return 'http://www.servicios.clarin.com/notas/jsp/clarin/v9/notas/imprimir.jsp?pagid=' + lmain + \ No newline at end of file diff --git a/src/calibre/web/feeds/recipes/recipe_infobae.py b/src/calibre/web/feeds/recipes/recipe_infobae.py new file mode 100644 index 0000000000..b6975d9a60 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_infobae.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +infobae.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Infobae(BasicNewsRecipe): + title = 'Infobae.com' + __author__ = 'Darko Miletic' + description = 'Informacion Libre las 24 horas' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'iso-8859-1' + cover_url = 'http://www.infobae.com/imgs/header/header.gif' + + html2lrf_options = [ + '--comment' , description + , '--category' , 'news, Argentina' + , '--publisher' , 'Infobae.com' + ] + + + + feeds = [ + (u'Noticias' , u'http://www.infobae.com/adjuntos/html/RSS/hoy.xml' ) + ,(u'Salud' , u'http://www.infobae.com/adjuntos/html/RSS/salud.xml' ) + ,(u'Tecnologia', u'http://www.infobae.com/adjuntos/html/RSS/tecnologia.xml') + ,(u'Deportes' , u'http://www.infobae.com/adjuntos/html/RSS/deportes.xml' ) + ] + + def print_version(self, url): + main, sep, article_part = url.partition('contenidos/') + article_id, rsep, rrest = article_part.partition('-') + return u'http://www.infobae.com/notas/nota_imprimir.php?Idx=' + article_id diff --git a/src/calibre/web/feeds/recipes/recipe_pagina12.py b/src/calibre/web/feeds/recipes/recipe_pagina12.py new file mode 100644 index 0000000000..8b427e8ad1 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_pagina12.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +pagina12.com.ar +''' + +from calibre import strftime +from calibre.web.feeds.news import BasicNewsRecipe + +class Pagina12(BasicNewsRecipe): + title = u'Pagina/12' + __author__ = 'Darko Miletic' + description = 'Noticias de Argentina y el resto del mundo' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'cp1252' + cover_url = strftime('http://www.pagina12.com.ar/fotos/%Y%m%d/diario/TAPAN.jpg') + + html2lrf_options = [ + '--comment' , description + , '--category' , 'news, Argentina' + , '--publisher' , 'La Pagina S.A.' + ] + + + remove_tags = [ + dict(name='div', attrs={'id':'volver'}) + ,dict(name='div', attrs={'id':'logo' }) + ] + + + feeds = [(u'Pagina/12', u'http://www.pagina12.com.ar/diario/rss/principal.xml')] + + def print_version(self, url): + return url.replace('http://www.pagina12.com.ar/','http://www.pagina12.com.ar/imprimir/')