except: pass
def watchdog(self):
- if time.time() > self.parent.cfg.get('watchdog', 'maxtime', default=300)+self.lastreceived:
+ if time.time() > int(self.parent.cfg.get('watchdog', 'maxtime', default=300))+self.lastreceived:
self.parse("ERROR :Fake-error from watchdog timer.")
- self.watchdogtimer = MyTimer(self.parent.cfg.get('watchdog', 'interval', default=30), self.watchdog)
+ self.watchdogtimer = MyTimer(int(self.parent.cfg.get('watchdog', 'interval', default=30)), self.watchdog)
def log(self, *args, **kwargs):
self.parent.log(self.nick, *args, **kwargs)
cfg = config.setup('bot.config')
- if int(cfg.get('debug', 'gc', default=0)) == 1:
+ if cfg.getboolean('debug', 'gc'):
gc.set_debug(gc.DEBUG_LEAK)
pidfile = open(cfg.pidfile, 'w')
@lib.hook(needchan=False)
@lib.help(None, "provides command list")
def showcommands(bot, user, chan, realtarget, *args):
- if bool(int(bot.parent.cfg.get('help', 'autogen', default=0))):
+ if bot.parent.cfg.getboolean('help', 'autogen'):
try:
_genhelp(bot, user, chan, realtarget, *args)
except: pass