zs

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

commit 73155c989873968a3e2add03956ee1ad09a8ee2a
parent 811309536c6a286b10cb0590a63436144f20a2fd
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sun,  9 Sep 2018 09:42:43 +0200

Do not save if default values.

Diffstat:
zeitungsschau/feeddb.py | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/zeitungsschau/feeddb.py b/zeitungsschau/feeddb.py @@ -18,6 +18,7 @@ class feeddb(object): lpath = "" lockarr = "" locks = {} + default = True def lock(self, fpath): if fpath not in self.locks: @@ -78,6 +79,8 @@ class feeddb(object): print("You need to specify the default email. Please "\ "run 'zs cfg email me@me.com' to "\ "set it.") + else: + default = False if not "smtphost" in self.cfg: self.cfg["smtphost"] = "localhost" @@ -97,9 +100,9 @@ class feeddb(object): self.cfg["smtpuselocal"] = "False" def sync(self): - if self.cfg != None: + if self.cfg != None and self.default == False: self.picklewrite("cfg.db", self.cfg) - if self.feeds != None: + if self.feeds != None and self.default == False: self.picklewrite("feeds.db", self.feeds) def __del__(self):