summaryrefslogtreecommitdiff
path: root/watchnews-cli
diff options
context:
space:
mode:
Diffstat (limited to 'watchnews-cli')
-rwxr-xr-xwatchnews-cli20
1 files changed, 10 insertions, 10 deletions
diff --git a/watchnews-cli b/watchnews-cli
index 2fe9cd5..df41706 100755
--- a/watchnews-cli
+++ b/watchnews-cli
@@ -9,7 +9,7 @@ import logging
logging.basicConfig(level=logging.INFO)
-if __name__ == "__main__":
+if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('--add', metavar='URL',
help='add feed with URL')
@@ -23,11 +23,11 @@ if __name__ == "__main__":
help='List all registered feeds')
parser.add_argument('--web', action='store_true',
help='Run web interface')
- parser.add_argument("--db", metavar="DBPATH",
- default=os.path.join(os.path.dirname(__file__), "db.sqlite"),
- help="Path to sqlite database file")
- parser.add_argument("--rss", action='store_true',
- help="Dump a RSS feeds")
+ parser.add_argument('--db', metavar='DBPATH',
+ default=os.path.join(os.path.dirname(__file__), 'db.sqlite'),
+ help='Path to sqlite database file')
+ parser.add_argument('--rss', action='store_true',
+ help='Dump a RSS feeds')
args = parser.parse_args()
@@ -38,21 +38,21 @@ if __name__ == "__main__":
try:
fetch.update(feed)
except Exception as e:
- logging.exception("Failed to update %s", feed.url)
+ logging.exception('Failed to update %s', feed.url)
if args.update_feed:
feed = data.Feed.get(data.Feed.id == args.update_feed)
if feed:
fetch.update(feed)
if args.add:
feed = data.Feed.create(url=args.add)
- print("Added {}".format(feed))
+ print('Added {}'.format(feed))
if args.remove:
feed = data.Feed.get(data.Feed.id == args.remove)
feed.delete_instance()
- print("Removed {}".format(feed))
+ print('Removed {}'.format(feed))
if args.list:
for feed in data.Feed.select().order_by(data.Feed.created_date):
- print("{0.id} - {1} - {0.title} - {0.url}".format(
+ print('{0.id} - {1} - {0.title} - {0.url}'.format(
feed, feed.created_date.strftime('%x %X')))
if args.web:
web.get_app().run()