You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
995 B
Python

import main
from string import digits
#from utils.logging.log import *
def setWho(network, newObjects):
if not network in main.wholist.keys():
main.wholist[network] = {}
for i in newObjects.keys():
main.wholist[network][i] = newObjects[i]
return
def setWhoSingle(network, nick, ident, host):
if network in main.wholist.keys():
if nick in main.wholist[network].keys():
main.wholist[network][nick][1] = ident
main.wholist[network][nick][2] = host
else:
main.wholist[network][nick] = [nick, ident, host, None, None, None]
else:
main.wholist[network] = {nick: [nick, ident, host, None, None, None]}
def getWho(nick):
result = {}
for i in main.wholist.keys():
for x in main.wholist[i].keys():
if nick.lower() == x.lower():
if not i in result.keys():
result[i] = []
result[i].append(main.wholist[i][x])
return result