Merge lp:~verterok/unity-scope-googlenews/fix-metadata-published-key into lp:unity-scope-googlenews

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: James Henstridge
Approved revision: 65
Merged at revision: 64
Proposed branch: lp:~verterok/unity-scope-googlenews/fix-metadata-published-key
Merge into: lp:unity-scope-googlenews
Diff against target: 67 lines (+17/-11)
1 file modified
src/unity_googlenews_daemon.py (+17/-11)
To merge this branch: bzr merge lp:~verterok/unity-scope-googlenews/fix-metadata-published-key
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
James Henstridge Approve
David Callé Approve
Review via email: mp+165239@code.launchpad.net

Commit message

Use 'updated' key for the published metadata field if 'published' isn't there.

Description of the change

Use 'updated' key for the published metadata field if 'published' isn't there.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
David Callé (davidc3) wrote :

LGTM +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
James Henstridge (jamesh) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity_googlenews_daemon.py'
2--- src/unity_googlenews_daemon.py 2013-04-25 22:23:11 +0000
3+++ src/unity_googlenews_daemon.py 2013-05-22 20:46:27 +0000
4@@ -2,16 +2,16 @@
5 # -*- coding: utf-8 -*-
6
7 # Copyright (C) 2013 David Callé <davidc@framli.eu>
8-# This program is free software: you can redistribute it and/or modify it
9-# under the terms of the GNU General Public License version 3, as published
10+# This program is free software: you can redistribute it and/or modify it
11+# under the terms of the GNU General Public License version 3, as published
12 # by the Free Software Foundation.
13-#
14-# This program is distributed in the hope that it will be useful, but
15-# WITHOUT ANY WARRANTY; without even the implied warranties of
16-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
17+#
18+# This program is distributed in the hope that it will be useful, but
19+# WITHOUT ANY WARRANTY; without even the implied warranties of
20+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
21 # PURPOSE. See the GNU General Public License for more details.
22-#
23-# You should have received a copy of the GNU General Public License along
24+#
25+# You should have received a copy of the GNU General Public License along
26 # with this program. If not, see <http://www.gnu.org/licenses/>.
27
28 from gi.repository import Unity, UnityExtras
29@@ -51,7 +51,7 @@
30 'name' :_('Local'),
31 'icon' :SVG_DIR+'group-news.svg',
32 'renderer':Unity.CategoryRenderer.VERTICAL_TILE}
33-c2 = {'id' :'top',
34+c2 = {'id' :'top',
35 'name' :_('Top Stories'),
36 'icon' :SVG_DIR+'group-news.svg',
37 'renderer':Unity.CategoryRenderer.VERTICAL_TILE}
38@@ -141,13 +141,19 @@
39 img = img.replace('/0.jpg', '/1.jpg')
40 else:
41 img = None
42+ if 'published' not in f:
43+ # support feedparser == 5.1
44+ published = f['updated']
45+ else:
46+ published = f['published']
47+
48 results.append({'uri':f['link'],
49 'icon':img,
50 'category':cat,
51 'comment':f['summary'],
52 'title':f['title'],
53 'language':country,
54- 'published':f['published']})
55+ 'published':published})
56 return results
57
58
59@@ -254,7 +260,7 @@
60 '''
61 fs = Unity.FilterSet.new ()
62 # if FILTERS:
63-#
64+#
65 return fs
66
67 def do_get_group_name (self):

Subscribers

People subscribed via source and target branches