[dakbot/master] Do not warn/unlock users if NEW lock is held
Signed-off-by: Luca Falavigna <dktrkranz@debian.org>
---
Dak/plugin.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Dak/plugin.py b/Dak/plugin.py
index b11f88c..1dee6ad 100644
--- a/Dak/plugin.py
+++ b/Dak/plugin.py
@@ -77,9 +77,9 @@ class Dak(callbacks.Plugin):
return
irc.queueMsg(msgMaker(self.channel, "It is DINSTALL time"))
if len(self.locks) >= 1:
- for key in self.locks:
+ for key in [lock for lock in self.locks if lock != 'NEW']:
irc.queueMsg(msgMaker(self.channel, "%s: DINSTALL time, stop working, unlocking %s" % (self.locks[key], key)))
- self.locks={}
+ map(lambda lock: self.locks.pop(lock), [lock for lock in self.locks if lock != 'NEW'])
return
elif nextdinstall <= self.warntime:
# Not dinstall as far as we know, but we want to warn people if they have locks, dinstall is soon.
@@ -95,7 +95,7 @@ class Dak(callbacks.Plugin):
if len(self.locks) >= 1:
conf.supybot.plugins.Dak.get('warned').setValue(True)
- for key in self.locks:
+ for key in [lock for lock in self.locks if lock != 'NEW']:
log.debug("DAK: Warning %s, has %s locked." % (self.locks[key], key))
irc.queueMsg(msgMaker(self.channel, "%s: DINSTALL soon, hurry up" % (self.locks[key]) ))
if key == "ALL":
--
1.7.2.5
Reply to: