zs

Zeitungsschau rss to email converter
git clone git://r-36.net/zs
Log | Files | Refs | LICENSE

commit 8b3f51dc70e6367c695df26990b403d397c26346
parent a8d6277ef2b6adfd085a13ac1d01bd0a054a47a7
Author: Christoph Lohmann <20h@r-36.net>
Date:   Fri,  2 May 2014 17:15:13 +0200

Fixing the deletion of feeds.

Diffstat:
config.mk | 3++-
feeddb.py | 3+++
zs.py | 7++++---
3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/config.mk b/config.mk @@ -9,5 +9,6 @@ PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man # compiler and linker -CC = nuitka --recurse-all +CC = nuitka --recurse-all --recurse-directory --show-modules \ + --show-progress diff --git a/feeddb.py b/feeddb.py @@ -148,6 +148,9 @@ class feeddb(object): def delfeed(self, uri): if uri in self.listfeeds(): del self.feeds[uri] + return True + else: + return False def listactivefeeds(self): rfeeds = [] diff --git a/zs.py b/zs.py @@ -14,6 +14,7 @@ import feedemail import urllib.error import socket import http.client +import ssl def sendfeed(db, ufeed): feedemail.send(ufeed, db.cfg["email"], db.cfg["smtphost"], \ @@ -139,8 +140,7 @@ def main(args): db.addfeed(args[2]) elif args[1] == "list": - for f in db.listfeeds(): - print(f) + print("\n".join(db.listfeeds())) elif args[1] == "listuuids": if len(args) < 3: @@ -165,7 +165,8 @@ def main(args): elif args[1] == "del": if len(args) < 3: usage(args[0]) - db.delfeed(args[1]) + if db.delfeed(args[2]) == True: + print("'%s' has been deleted." % (args[2])) elif args[1] == "reset": if len(args) < 3: