Merge from trunk

This commit is contained in:
Charles Haley 2012-06-02 13:28:11 +02:00
commit 3fcf2caf53
292 changed files with 82725 additions and 78956 deletions

View File

@ -3,9 +3,9 @@
src/calibre/plugins
resources/images.qrc
src/calibre/ebooks/oeb/display/test/*.js
src/calibre/manual/.build/
src/calibre/manual/cli/
src/calibre/manual/template_ref.rst
manual/.build/
manual/cli/
manual/template_ref.rst
build
dist
docs

View File

@ -4,11 +4,6 @@ License: GPL-3
The full text of the GPL is distributed as in
/usr/share/common-licenses/GPL-3 on Debian systems.
Files: src/calibre/ebooks/pdf/*.h,*.cpp
License: GPL-2 or later
The full text of the GPL is distributed as in
/usr/share/common-licenses/GPL-2 on Debian systems.
Files: setup/iso_639/*
Copyright: Various
License: LGPL 2.1

View File

@ -19,6 +19,191 @@
# new recipes:
# - title:
- version: 0.8.54
date: 2012-05-31
new features:
- title: "E-book viewer: The Table of contents panel now tracks the current position in the book. As you scroll through the book, the entry you are currently on is highlighted."
type: major
description: "To see this feature in action, open the Table of Contents panel in the viewer by clicking the button with three blue lines on it. As you page through the book, the chapter you are reading currently is highlighted in the Table of Contents Panel. Obviously, this will only work if the book you are reading has a Table of Contents. You can also use the Ctrl+PgUp and Ctrl+PgDn keys to quickly skip between chapters."
- title: "calibredb: Allow setting metadata for individual fields with the set_metadata command"
- title: "Make it a little harder to accidentally change the sorting of items in the Tag Browser. Also frees up more vertical space for the Tag Browser itself."
- title: "The calibre user manual is now available in AZW3 format as well as EPUB"
bug fixes:
- title: "Automatic titlecasing: No longer try to capitalize scottish names, as there are too many special cases."
tickets: [775825]
- title: "Never crash when reading metadata from PDF files (reading now always happens in a worker process)"
tickets: [1006452]
- title: "EPUB Input: Do no skip the valid children of an NCX node that has no text/href"
- title: "Archos driver: Detect SD card"
tickets: [1005650]
- title: "When bulk downloading metadata and the user deletes one of the books for which metadata is being downloaded, just ignore it, instead of erroring out"
- title: "When deleting books from the bottom of the booklist, ensure that the bottom book after deleting is selected"
- title: "Fix regression in 0.8.53 that broke sending APNX files to older Kindle devices"
- title: "Use correct text color for selected rows in the list of matches when downloading metadata and showing results in get books."
tickets: [1004568]
improved recipes:
- The Independent
- Welt der Physik
- China Daily
- The Grid
- Prospect Magazine
new recipes:
- title: La gazetta del Mezzogiorno
author: faber1971
- version: 0.8.53
date: 2012-05-25
new features:
- title: "Kindle Touch/4 driver: Upload cover thumbnails when sending books to device by USB to workaround Amazon bug of not displaying covers for sync-enabled books"
- title: "Support for updating metadata in FB2 files"
- title: "Set a different background color when choosing formats to not delete as opposed to choosing format to delete."
tickets: [ 1001741 ]
- title: "E-book viewer: Add an option to prevent the up and down arrow keys from scrolling past page breaks"
- title: "Get Books: Remove ebookshoppe.com at the website's request"
bug fixes:
- title: "PDF Input: Support image rotation commands in PDF files. Fixes the long standing problem of some images being flipped when converting from PDF in calibre."
- title: "Fix a regression in 0.8.51 that caused conversion to HTMLZ to not have any CSS"
- title: "Get Books: Fix website change at kobo.com causing prices not to be found"
- title: "Edit the time in the 24 hour clock when calibre's interface language is set to German."
tickets: [ 1001809 ]
- title: "MOBI Output: When generating joint KF8/MOBI6 .mobi files set the text length field in the MOBI 6 header correctly. "
tickets: [ 1003489 ]
- title: "ODT Input: More workarounds for LibreOffice 3.5's habit of inserting pointless margin:100% directives everywhere."
tickets: [ 1002702 ]
- title: "Fix regression that broke smarten punctuation when quotes were next to html tags."
tickets: [ 998900 ]
- title: "Fix published date from ozon.ru wrong in some timezones"
tickets: [ 975338 ]
- title: "Catalogs: Handle the use of custom columns with non-ascii names correctly"
tickets: [1001437]
- title: "Conversion pipeline: Remove the attempt to detect and autocorrect if text will go off the left edge of the page, as it was a rather crude heuristic. Also do not remove fake margins if the book uses negative text indents on the margined elements."
- title: "KF8 Output: Set offsets to tags in the skeleton the same way kindlegen does. Also linearize non linear ToCs to ensure section to section jumping works."
- title: "Conversion pipeline: Use correct default value of 'inherit' for font-family and font-size when normalizing the shorthand font property."
- title: "When running python scripts via calibre-debug ensure that user plugins are loaded"
improved recipes:
- Business Week Magazine
- Metro Nieuws NL
new recipes:
- title: Attac.es
author: Marc Busque
- title: Drytooling.com
author: Damian Granowski
- title: Shortlist.com
author: Dave ASbury
- title: National Geographic (es)
author: vakya
- version: 0.8.52
date: 2012-05-18
new features:
- title: "EPUB Input: When setting the cover for a book that identifies its cover image, but not the html wrapper around the cover, try to detect and remove that wrapper automatically."
tickets: [ 999959 ]
- title: "When deleting books of a specific format, show the number of books with each format available"
- title: "Linux install: No longer create MAN pages as all utilities have more comprehensive command line --help anyway"
- title: "Add a tweak Preferences->Tweaks to control the default choice of format for the Tweak Book feature"
- title: "Conversion: Allow setting negative page margins. A negative page margin means that calibre will not specify any page margin in the output document (for formats that support this)"
bug fixes:
- title: "Tweak book: Fix handling of covers when tweaking KF8 books"
- title: "KF8 Output: Handle input documents with out of sequence ToC entries. Note that currently section jumping in the KF8 output produced by calibre for such files does not work."
tickets: [1000493]
- title: "Edit metadata dialog: Fix the edit values button for custom tag-like columns showing a unneeded warning about changed values"
- title: "EPUB Output: Be a little more conservative when removing <form> tags. Only remove them if they have actual forms inside. "
tickets: [ 1000384 ]
- title: "EPUB Input: Correctly update the Cover entry in the ToC even when the entry has a fragment reference. "
tickets: [ 999973 ]
- title: "Update ImagMagick DLLs in all calibre binary builds to fix security vulnerabilities in ImageMagick"
tickets: [ 999496 ]
- title: "Advanced search dialog: Fix equals and regex matching not being applied for custom column searches."
tickets: [ 980221 ]
- title: "RTF Input: Handle old RTF files that have commands without braces."
tickets: [ 994133 ]
- title: "Get Books: Diesel, fix results not showing when only a single match is found"
- title: "Get Books: Fix DRM status indicators for Kobo and Diesel stores. Fix smashwords not returning results."
tickets: [ 993755 ]
- title: "Fix regression in 0.8.51 that broke viewing of LIT and some EPUB files"
tickets: [998248, 998216]
improved recipes:
- Clarin
- Spiegel
- Spiegel International
- Montreal Gazette
- Gosc Niedzelny
- Ars Technica
new recipes:
- title: "Army/Navy/Air force/Marine Times and News busters"
author: jde
- title: "Ads of the World, Heavy Meta (Italian) and Juve La Stampa"
author: faber1971
- title: "Revista Summa"
author: Vakya
- title: "Strategic culture"
author: Darko Miletic
- title: Stars and Stripes
author: adoucette
- title: Nackdenkseiten
author: jrda
- version: 0.8.51
date: 2012-05-11

View File

@ -14,7 +14,7 @@
import sys, os
# If your extensions are in another directory, add it here.
sys.path.append(os.path.abspath('../../../'))
sys.path.append(os.path.abspath('../src'))
sys.path.append(os.path.abspath('.'))
__appname__ = os.environ.get('__appname__', 'calibre')
__version__ = os.environ.get('__version__', '0.0.0')
@ -98,7 +98,7 @@ html_favicon = 'favicon.ico'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the built-in static files,
# so a file named "default.css" will overwrite the built-in "default.css".
html_static_path = ['resources', '../../../icons/favicon.ico']
html_static_path = ['resources', '../icons/favicon.ico']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.

View File

@ -669,7 +669,6 @@ Some limitations of PDF input are:
* Complex, multi-column, and image based documents are not supported.
* Extraction of vector images and tables from within the document is also not supported.
* Some PDFs use special glyphs to represent ll or ff or fi, etc. Conversion of these may or may not work depending on just how they are represented internally in the PDF.
* Some PDFs store their images upside down with a rotation instruction, |app| currently doesn't support that instruction, so the images will be rotated in the output as well.
* Links and Tables of Contents are not supported
* PDFs that use embedded non-unicode fonts to represent non-English characters will result in garbled output for those characters
* Some PDFs are made up of photographs of the page with OCRed text behind them. In such cases |app| uses the OCRed text, which can be very different from what you see when you view the PDF file

View File

@ -5,9 +5,9 @@ __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import sys, os, re, textwrap
sys.path.insert(0, os.path.abspath('../../'))
sys.extensions_location = '../plugins'
sys.resources_location = '../../../resources'
sys.path.insert(0, os.path.abspath('../src'))
sys.extensions_location = '../src/calibre/plugins'
sys.resources_location = '../resources'
from sphinx.util.console import bold
@ -116,44 +116,42 @@ def generate_ebook_convert_help(preamble, info):
from calibre.utils.logging import default_log
preamble = re.sub(r'http.*\.html', ':ref:`conversion`', preamble)
raw = preamble + textwrap.dedent('''
Since the options supported by ebook-convert vary depending on both the
input and the output formats, the various combinations are listed below:
The options and default values for the options change depending on both the
input and output formats, so you should always check with::
ebook-convert myfile.input_format myfile.output_format -h
Below are the options that are common to all conversion, followed by the
options specific to every input and output format
''')
toc = {}
sec_templ = textwrap.dedent('''\
.. include:: ../global.rst
{0}
================================================================
.. contents:: Contents
:depth: 1
:local:
''')
for i, ip in enumerate(input_format_plugins()):
sraw = sec_templ.format(ip.name)
toc[ip.name] = 'ebook-convert-%d'%i
for op in output_format_plugins():
title = ip.name + ' to ' + op.name
parser, plumber = create_option_parser(['ebook-convert',
'dummyi.'+list(ip.file_types)[0],
'dummyo.'+op.file_type, '-h'], default_log)
cmd = 'ebook-convert '+list(ip.file_types)[0]+' '+op.file_type
'dummyi.mobi', 'dummyo.epub', '-h'], default_log)
groups = [(None, None, parser.option_list)]
for grp in parser.option_groups:
groups.append((grp.title, grp.description, grp.option_list))
options = '\n'.join(render_options(cmd, groups, False))
sraw += title+'\n------------------------------------------------------\n\n'
sraw += options + '\n\n'
update_cli_doc(os.path.join('cli', toc[ip.name]+'.rst'), sraw, info)
if grp.title not in {'INPUT OPTIONS', 'OUTPUT OPTIONS'}:
groups.append((grp.title.title(), grp.description, grp.option_list))
options = '\n'.join(render_options('ebook-convert', groups, False))
raw += '\n\n.. contents::\n :local:'
raw += '\n\n' + options
for pl in sorted(input_format_plugins(), key=lambda x:x.name):
parser, plumber = create_option_parser(['ebook-convert',
'dummyi.'+list(pl.file_types)[0], 'dummyo.epub', '-h'], default_log)
groups = [(pl.name+ ' Options', '', g.option_list) for g in
parser.option_groups if g.title == "INPUT OPTIONS"]
prog = 'ebook-convert-'+(pl.name.lower().replace(' ', '-'))
raw += '\n\n' + '\n'.join(render_options(prog, groups, False, True))
for pl in sorted(output_format_plugins(), key=lambda x: x.name):
parser, plumber = create_option_parser(['ebook-convert', 'd.epub',
'dummyi.'+pl.file_type, '-h'], default_log)
groups = [(pl.name+ ' Options', '', g.option_list) for g in
parser.option_groups if g.title == "OUTPUT OPTIONS"]
prog = 'ebook-convert-'+(pl.name.lower().replace(' ', '-'))
raw += '\n\n' + '\n'.join(render_options(prog, groups, False, True))
toct = '\n\n.. toctree::\n :maxdepth: 2\n\n'
for ip in sorted(toc):
toct += ' ' + toc[ip]+'\n'
raw += toct+'\n\n'
update_cli_doc(os.path.join('cli', 'ebook-convert.rst'), raw, info)
def update_cli_doc(path, raw, info):

View File

@ -39,7 +39,7 @@ Tweaks
Tweaks are small changes that you can specify to control various aspects of |app|'s behavior. You can change them by going to Preferences->Advanced->Tweaks.
The default values for the tweaks are reproduced below
.. literalinclude:: ../../../resources/default_tweaks.py
.. literalinclude:: ../resources/default_tweaks.py
Overriding icons, templates, et cetera

View File

@ -45,6 +45,16 @@ All the |app| python code is in the ``calibre`` package. This package contains t
The format independent code is all in ebooks.oeb and the format dependent code is in ebooks.format_name.
* Metadata reading, writing, and downloading is all in ebooks.metadata
* Conversion happens in a pipeline, for the structure of the pipeline,
see :ref:`conversion-introduction`. The pipeline consists of an input
plugin, various transforms and an output plugin. The code constructs
and drives the pipeline is in plumber.py. The pipeline works on a
representation of an ebook that is like an unzipped epub, with
manifest, spine, toc, guide, html content, etc. The
class that manages this representation is OEBBook in oeb/base.py. The
various transformations that are applied to the book during
conversions live in `oeb/transforms/*.py`. And the input and output
plugins live in `conversion/plugins/*.py`.
* library - The database back-end and the content server. See library.database2 for the interface to the |app| library. library.server is the |app| Content Server.
* gui2 - The Graphical User Interface. GUI initialization happens in gui2.main and gui2.ui. The ebook-viewer is in gui2.viewer.

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 662 B

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 228 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 724 B

After

Width:  |  Height:  |  Size: 724 B

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -17,7 +17,7 @@ To get started with more advanced usage, you should read about the :ref:`Graphic
.. only:: online
**An ebook version of this user manual is available in** `EPUB format <calibre.epub>`_.
**An ebook version of this user manual is available in** `EPUB format <calibre.epub>`_ and `AZW3 (Kindle Fire) format <calibre.azw3>`_.
Sections
------------

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -55,7 +55,7 @@ The python implementation of the template functions is passed in a Metadata obje
The set of standard metadata fields.
.. literalinclude:: ../ebooks/metadata/book/__init__.py
.. literalinclude:: ../src/calibre/ebooks/metadata/book/__init__.py
:lines: 7-
'''

View File

@ -4,9 +4,8 @@ __copyright__ = '2008-2012, Darko Miletic <darko.miletic at gmail.com>'
arstechnica.com
'''
import re
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
from calibre.ebooks.BeautifulSoup import BeautifulSoup
class ArsTechnica(BasicNewsRecipe):
title = u'Ars Technica'

21
recipes/attac_es.recipe Normal file
View File

@ -0,0 +1,21 @@
from calibre.web.feeds.news import BasicNewsRecipe
class AttacEspanaRecipe (BasicNewsRecipe):
__author__ = u'Marc Busqué'
__url__ = 'http://www.lamarciana.com'
__version__ = '1.0'
__license__ = 'GPL v3'
__copyright__ = u'2012, Marc Busqué <marc@lamarciana.com>'
title = u'attac.es'
description = u'La Asociación por la Tasación de las Transacciones Financieras y por la Ayuda a los Ciudadanos (ATTAC) es un movimiento internacional altermundialista que promueve el control democrático de los mercados financieros y las instituciones encargadas de su control mediante la reflexión política y la movilización social.'
url = 'http://www.attac.es'
language = 'es'
tags = 'contrainformación, información alternativa'
oldest_article = 7
remove_empty_feeds = True
no_stylesheets = True
cover_url = u'http://www.attac.es/wp-content/themes/attacweb/images/attaces.jpg'
feeds = [
(u'Attac', u'http://www.attac.es/feed'),
]

View File

@ -15,6 +15,7 @@ class BusinessWeek(BasicNewsRecipe):
oldest_article = 7
max_articles_per_feed = 200
no_stylesheets = True
auto_cleanup = True
encoding = 'utf8'
use_embedded_content = False
language = 'en'
@ -36,12 +37,12 @@ class BusinessWeek(BasicNewsRecipe):
, 'language' : language
}
remove_tags = [
dict(attrs={'class':'inStory'})
,dict(name=['meta','link','iframe','base','embed','object','table','th','tr','td'])
,dict(attrs={'id':['inset','videoDisplay']})
]
keep_only_tags = [dict(name='div', attrs={'id':['story-body','storyBody']})]
#remove_tags = [
#dict(attrs={'class':'inStory'})
#,dict(name=['meta','link','iframe','base','embed','object','table','th','tr','td'])
#,dict(attrs={'id':['inset','videoDisplay']})
#]
#keep_only_tags = [dict(name='div', attrs={'id':['story-body','storyBody']})]
remove_attributes = ['lang']
match_regexps = [r'http://www.businessweek.com/.*_page_[1-9].*']
@ -100,3 +101,4 @@ class BusinessWeek(BasicNewsRecipe):
tstr = alink.string
alink.replaceWith(tstr)
return soup

View File

@ -1,5 +1,5 @@
__license__ = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
__copyright__ = '2010 - 2012, Darko Miletic <darko.miletic at gmail.com>'
'''
www.chinadaily.com.cn
'''
@ -21,7 +21,11 @@ class Pagina12(BasicNewsRecipe):
remove_empty_feeds = True
publication_type = 'newsportal'
masthead_url = 'http://www.chinadaily.com.cn/15421.files/chinadailylogo_e_20100301.jpg'
extra_css = ' body{font-family: Arial,Helvetica,sans-serif } '
extra_css = """
body{font-family: Arial,Helvetica,sans-serif }
.titlebox{font-family: "Times New Roman",Times,serif}
.timebox, .authorbox{font-size: x-small}
"""
conversion_options = {
'comment' : description
@ -31,7 +35,7 @@ class Pagina12(BasicNewsRecipe):
}
remove_tags = [dict(name=['object','embed','iframe','table'])]
keep_only_tags = [dict(attrs={'id':['Title_e','Content']})]
keep_only_tags = [dict(attrs={'class':['titlebox', 'timebox', 'authorbox', 'cont-ins']})]
feeds = [
@ -41,8 +45,3 @@ class Pagina12(BasicNewsRecipe):
,(u'Sports' , u'http://www.chinadaily.com.cn/rss/sports_rss.xml' )
,(u'Opinions', u'http://www.chinadaily.com.cn/rss/opinion_rss.xml' )
]
def preprocess_html(self, soup):
for item in soup.findAll(style=True):
del item['style']
return soup

Some files were not shown because too many files have changed in this diff Show More