def _handleMotd(line): log, f = None, None # Set logging function if _options['daemon']: if util.existsNickFile(_options['nick'], ".motd"): f = open(util.nickFile(_options['nick'], ".motd"), "w") log = f.write else: return else: log = _options['logger'].log # Log the Message of the Day if handlers.motdData['state'] == "received": log(util.autotab(handlers.motdData['message'])) elif handlers.motdData['state'] == "receiving": log("MotD in progress, try again") else: log("No motd received.") if _options['daemon']: try: f.close() except: pass
def _getStatus(opts, pipe): _options['logger'].log(util.autotab(pipe.read()))