Add more debug
authorJoerg Jaspert <joerg@debian.org>
Sun, 28 Dec 2008 14:01:24 +0000 (15:01 +0100)
committerJoerg Jaspert <joerg@debian.org>
Sun, 28 Dec 2008 14:01:24 +0000 (15:01 +0100)
Dak/plugin.py

index 3567eac..69edeed 100644 (file)
@@ -13,7 +13,6 @@ import supybot.plugins as plugins
 import supybot.ircmsgs as ircmsgs
 import supybot.callbacks as callbacks
 import supybot.schedule as schedule
-import supybot.registry as registry
 import supybot.conf as conf
 
 class Dak(callbacks.Plugin):
@@ -47,12 +46,12 @@ class Dak(callbacks.Plugin):
                     if minute in self.dinstallframe:
                         log.debug("DAK: In Dinstall timeframe")
                         # No longer time to warn only, now is time to act, if we haven't already
-                        if self.registryValue('dinstall'):
-                            log.debug("DAK: Already done once, dinstall flag is true")
+                        if self.registryValue('dinstall') == True:
+                            log.debug("DAK: Already done once, dinstall flag is %s" %(self.registryValue('dinstall')))
                             return
-                        log.debug("DAK: Not yet done, dinstall flag false")
+                        log.debug("DAK: Not yet done, dinstall flag %s" % (self.registryValue('dinstall')))
                         conf.supybot.plugins.Dak.get('dinstall').setValue(True)
-                        conf.supybot.plugins.Dak.get('warned').setValue(False)
+                        conf.supybot.plugins.Dak.get('warned').setValue(True)
                         irc.queueMsg(msgMaker(self.channel, "It is DINSTALL time"))
                         if len(self.locks) >= 1:
                             for key in self.locks:
@@ -65,10 +64,10 @@ class Dak(callbacks.Plugin):
                         # Also, with warnframe larger than dinstallframe, this might warn in case the bot somehow misses dinstallframe.
                         # Like if it comes up late, or so. Or?
                         log.debug("DAK: Not in Dinstall timeframe")
-                        if conf.supybot.plugins.Dak.get('warned'):
-                            log.debug("DAK: We already warned once, warn flag is true")
+                        if conf.supybot.plugins.Dak.get('warned') == True:
+                            log.debug("DAK: We already warned once, warn flag %s" % (self.registryValue('warned')))
                             return
-                        log.debug("DAK: Not yet warned about upcoming Dinstall run.")
+                        log.debug("DAK: Not yet warned about upcoming Dinstall run, flag is %s." % (self.registryValue('warned')))
 
                         if len(self.locks) >= 1:
                             conf.supybot.plugins.Dak.get('warned').setValue(True)
@@ -214,7 +213,7 @@ class Dak(callbacks.Plugin):
         newtopic = ""
         if m:
             newtopic = "%s || %s" % (m.group(1),
-                                           time.strftime("last NEW ended:  %b %d %H:%M UTC %Y", time.gmtime()))
+                                     time.strftime("last NEW ended:  %b %d %H:%M UTC %Y", time.gmtime()))
             if m.group(2):
                 newtopic += " || %s" % (m.group(2))
         else: