Fix #2823 (Medata from Filename) and add subtitles to Economist recipe

This commit is contained in:
Kovid Goyal 2009-07-14 07:24:55 -06:00
parent ee2fea02b6
commit ece4adfab9
3 changed files with 13 additions and 8 deletions

View File

@ -127,7 +127,7 @@ def metadata_from_filename(name, pat=None):
except IndexError: except IndexError:
pass pass
try: try:
au = match.group('authors') au = match.group('author')
aus = string_to_authors(au) aus = string_to_authors(au)
mi.authors = aus mi.authors = aus
except IndexError: except IndexError:

View File

@ -113,7 +113,7 @@ p, li { white-space: pre-wrap; }
<item row="1" column="1" colspan="2" > <item row="1" column="1" colspan="2" >
<widget class="QLineEdit" name="authors" > <widget class="QLineEdit" name="authors" >
<property name="toolTip" > <property name="toolTip" >
<string>Regular expression (?P&lt;authors>)</string> <string>Regular expression (?P&lt;author>)</string>
</property> </property>
<property name="text" > <property name="text" >
<string>No match</string> <string>No match</string>

View File

@ -63,6 +63,11 @@ class Economist(BasicNewsRecipe):
url=a['href'].replace('displaystory', 'PrinterFriendly') url=a['href'].replace('displaystory', 'PrinterFriendly')
if url.startswith('/'): if url.startswith('/'):
url = 'http://www.economist.com' + url url = 'http://www.economist.com' + url
try:
subtitle = tag.previousSibling.contents[0].contents[0]
text = subtitle + ': ' + text
except:
pass
article = dict(title=text, article = dict(title=text,
url = url, url = url,
description='', content='', date='') description='', content='', date='')