don't allow negative values for autorefresh

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2016-11-07 23:01:15 +01:00
parent a056c2777e
commit 9606cfcfc1
1 changed files with 4 additions and 0 deletions

View File

@ -71,6 +71,10 @@ class Account(CustomConfig.ConfigHelperMixin):
self.refreshperiod = self.getconffloat('autorefresh', 0.0)
self.dryrun = self.config.getboolean('general', 'dry-run')
self.quicknum = 0
if self.refreshperiod < 0:
self.ui.warn("autorefresh for %s is negative, fixing it to 0."%
name)
self.refreshperiod = 0.0
if self.refreshperiod == 0.0:
self.refreshperiod = None