def onQuit(e): to_write = "%s%s leaves%s" % (prefix(e), format_info_source(e), text(e)) for channame in chaninfo.channels(e.network): if chaninfo.ison(e.network, channame, e.source): window = windows.get(windows.ChannelWindow, e.network, channame) if window: window.write(to_write)
def onQuit(e): to_write = "%s%s leaves%s" % (prefix(e), format_info_source(e), text(e)) for channame in chaninfo.channels(e.network): if chaninfo.ison(e.network, channame, e.source): window = windows.get(windows.ChannelWindow, e.network, channame, core) if window: window.write(to_write)
def onQuit(e): to_write = "%s quit (%s)" % (e.source, e.text) for channame in chaninfo.channels(e.network): if chaninfo.ison(e.network, channame, e.source): window = windows.get(windows.ChannelWindow, e.network, channame) if window: f = log_file(e.network, window.id) f.write(to_write)
def onText(e): if chaninfo.ischan(e.network, e.target): if not hasattr(e.window, 'recent_speakers'): e.window.recent_speakers = [] for nick in e.window.recent_speakers: if nick == e.source or not chaninfo.ison(e.network, e.target, nick): e.window.recent_speakers.remove(nick) e.window.recent_speakers.insert(0, e.source)
def onQuit(e): reps = { 'nick':e.source, 'address':e.address, 'text':e.text, 'timestamp':time.strftime(theme.get('TimeStamp',default.get('TimeStamp'))), 'pre':theme.get('Prefix',default.get('Prefix')) } for window in windows.get_with(network=e.network): if chaninfo.ison(e.network, window.id, e.source): output('Quit',None,window,reps,widgets.EVENT)
def nick_completer(window, left, right, text): if isinstance(window, windows.QueryWindow): yield window.id recent_speakers = getattr(window, 'recent_speakers', ()) for nick in recent_speakers: if chaninfo.ison(window.network, window.id, nick): yield nick for nick in chaninfo.nicks(window.network, window.id): if nick not in recent_speakers: yield nick
def onText(e): if chaninfo.ischan(e.network, e.target): if not hasattr(e.window, 'recent_speakers'): e.window.recent_speakers = [] for nick in e.window.recent_speakers: if nick == e.source or not chaninfo.ison( e.network, e.target, nick): e.window.recent_speakers.remove(nick) e.window.recent_speakers.insert(0, e.source)
def onNick(e): color = getsourcecolor(e) if e.source == e.network.me: to_write = "%s%sYou are now known as %s" % (prefix(e), color, e.target) else: to_write = "%s%s%s is now known as %s" % (prefix(e), color, e.source, e.target) if e.source == e.network.me: for window in windows.get_with(network=e.network): window.write(to_write) else: for channame in chaninfo.channels(e.network): if chaninfo.ison(e.network,channame,e.source): window = windows.get(windows.ChannelWindow, e.network, channame) if window: window.write(to_write)
def onNick(e): color = getsourcecolor(e) if e.source == e.network.me: to_write = "%s%sYou are now known as %s" % (prefix(e), color, e.target) else: to_write = "%s%s%s is now known as %s" % (prefix(e), color, e.source, e.target) if e.source == e.network.me: for window in windows.get_with(core.manager, network=e.network): window.write(to_write) else: for channame in chaninfo.channels(e.network): if chaninfo.ison(e.network, channame, e.source): window = windows.get(windows.ChannelWindow, e.network, channame) if window: window.write(to_write)
def onNick(e): if e.source == e.network.me: to_write = 'You are now known as %s' % e.target for window in windows.get_with(network=e.network): f = log_file(e.network, window.id) f.write(to_write) else: to_write = '%s is now known as %s' % (e.source, e.target) for channame in chaninfo.channels(e.network): if chaninfo.ison(e.network,channame,e.source): window = windows.get(windows.ChannelWindow, e.network, channame) if window: f = log_file(e.network, window.id) f.write(to_write)
def is_nick(e): return isinstance(e.window, windows.ChannelWindow) and \ chaninfo.ison(e.window.network, e.window.id, e._target)
def can_see(network,nick): for window in chaninfo.channels(network): if chaninfo.ison(network, window, nick): return True return False