summaryrefslogtreecommitdiff
path: root/watchnews/fetch.py
diff options
context:
space:
mode:
Diffstat (limited to 'watchnews/fetch.py')
-rwxr-xr-xwatchnews/fetch.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/watchnews/fetch.py b/watchnews/fetch.py
index 5201c1e..e6c5c39 100755
--- a/watchnews/fetch.py
+++ b/watchnews/fetch.py
@@ -9,7 +9,7 @@ from newspaper.cleaners import DocumentCleaner
import logging
def update(feed):
- logging.info("Update %s", feed.url)
+ logging.info('Update %s', feed.url)
result = feedparser.parse(feed.url)
if result['feed']['title'] != feed.title:
feed.title = result['feed']['title']
@@ -44,7 +44,7 @@ def update(feed):
version.url = entry['link']
authors = paper.authors
authors.sort()
- version.authors = ", ".join(authors)
+ version.authors = ', '.join(authors)
version.title = paper.title
version.text = paper.text
@@ -64,7 +64,7 @@ def update(feed):
version.text = text
if len(version.text) < 2: # less than 2 chars is likely failure
- raise Exception("failed to parse {}\n{}".format(entry,version))
+ raise Exception('failed to parse {}\n{}'.format(entry,version))
# search if the previous version was the same
ident_version = data.Version.select().where(
@@ -74,10 +74,10 @@ def update(feed):
(data.Version.text == version.text)).first()
if ident_version:
- logging.info("No change, skip %s", item.uid)
+ logging.info('No change, skip %s', item.uid)
else:
version.save()
- logging.info("Saved new version of %s: %s", item.uid, version.id)
+ logging.info('Saved new version of %s: %s', item.uid, version.id)
except Exception as e:
- logging.exception("Failed to process %s", entry['link'])
+ logging.exception('Failed to process %s', entry['link'])