Ejemplo n.º 1
0
 def on_privmsg(self, c, e):
     self.check_reload(c, e)
     status = fb.priv_action(stateful, c, e)
     self.send_notices()
     if status:
         fb.render_html(conf.html_path, stateful)
         fb.render_rss(conf.rss_path, stateful)
Ejemplo n.º 2
0
def reload_log(logfile):
    if stateful.logfile:
        stateful.logfile.close()
    stateful.__init__()
    if not os.path.isfile(logfile):
        print('error:', logfile, 'not found')
        return
    for line in open(logfile):
        if line.startswith('#'):
            continue
        source,_,message = line.strip().partition('\t')
        e = Dummy()
        e.source = source
        e.arguments = [message]
        fb.priv_action(stateful, None, e)
    stateful.notices = []
    stateful.logfile = open(conf.logfile, 'a')