Merge from trunk

This commit is contained in:
Sengian 2010-11-28 14:03:52 +01:00
commit ecbca3413d
3 changed files with 11 additions and 5 deletions

View File

@ -13,6 +13,8 @@ class RevistaMuyInteresante(BasicNewsRecipe):
no_stylesheets = True
remove_javascript = True
conversion_options = {'linearize_tables': True}
extra_css = ' .txt_articulo{ font-family: sans-serif; font-size: medium; text-align: justify } .contentheading{font-family: serif; font-size: large; font-weight: bold; color: #000000; text-align: center}'
@ -39,11 +41,12 @@ class RevistaMuyInteresante(BasicNewsRecipe):
keep_only_tags = [dict(name='div', attrs={'class':['article']}),dict(name='td', attrs={'class':['txt_articulo']})]
remove_tags = [
dict(name=['object','link','script','ul'])
dict(name=['object','link','script','ul','iframe','ins'])
,dict(name='div', attrs={'id':['comment']})
,dict(name='td', attrs={'class':['buttonheading']})
,dict(name='div', attrs={'class':['tags_articles']})
,dict(name='div', attrs={'class':['tags_articles','bajo_title']})
,dict(name='table', attrs={'class':['pagenav']})
,dict(name='form', attrs={'class':['voteform']})
]
remove_tags_after = dict(name='div', attrs={'class':'tags_articles'})
@ -115,3 +118,5 @@ class RevistaMuyInteresante(BasicNewsRecipe):
if link_item:
cover_url = "http://www.muyinteresante.es"+link_item['src']
return cover_url

View File

@ -292,7 +292,8 @@ class RTFInput(InputFormatPlugin):
# Replace newlines inserted by the 'empty_paragraphs' option in rtf2xml with html blank lines
if not getattr(self.options, 'remove_paragraph_spacing', False):
res = re.sub('\s*<body>', '<body>', res)
res = re.sub('(?<=\n)\n{2}', u'<p>\u00a0</p>\n', res)
res = re.sub('(?<=\n)\n{2}',
u'<p>\u00a0</p>\n'.encode('utf-8'), res)
if self.options.preprocess_html:
preprocessor = PreProcessor(self.options, log=getattr(self, 'log', None))
res = preprocessor(res)

View File

@ -129,11 +129,11 @@ Here's a simple Hello World plugin for the |app| GUI. It will cause a box to pop
info_dialog(self.gui, 'Hello World!', 'Hellooo World!',
show=True)
return HelloWorld(gui, None)
return HelloWorld(gui, self.site_customization)
You can also have it show up in the toolbars/context menu by going to Preferences->Toolbars and adding this plugin to the locations you want it to be in.
While this plugin is utterly useless, note that all calibre GUI actions like adding/saving/removing/viewing/etc. are implemented as plugins, so there is no limit to what you can acheive. The key thing to remember is that the plugin has access to the full |app| GUI via ``self.gui``.
While this plugin is utterly useless, note that all calibre GUI actions like adding/saving/removing/viewing/etc. are implemented as plugins, so there is no limit to what you can achieve. The key thing to remember is that the plugin has access to the full |app| GUI via ``self.gui``.
The Plugin base class