2018-02-23 22:05:40 +00:00
|
|
|
from core.main import *
|
2018-03-04 17:25:57 +00:00
|
|
|
from string import digits
|
2018-02-23 22:05:40 +00:00
|
|
|
#from utils.logging.log import *
|
|
|
|
|
|
|
|
def setWho(network, newObjects):
|
2018-03-04 17:25:57 +00:00
|
|
|
network = "".join([x for x in network if not x in digits])
|
2018-02-23 22:05:40 +00:00
|
|
|
if not network in wholist.keys():
|
|
|
|
wholist[network] = {}
|
|
|
|
for i in newObjects.keys():
|
|
|
|
wholist[network][i] = newObjects[i]
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
def setWhoSingle(network, nick, ident, host):
|
2018-03-04 17:25:57 +00:00
|
|
|
network = "".join([x for x in network if not x in digits])
|
2018-02-23 22:05:40 +00:00
|
|
|
|
|
|
|
if network in wholist.keys():
|
|
|
|
if nick in wholist[network].keys():
|
|
|
|
wholist[network][nick][1] = ident
|
|
|
|
wholist[network][nick][2] = host
|
|
|
|
else:
|
|
|
|
wholist[network][nick] = [nick, ident, host, None, None, None]
|
|
|
|
|
|
|
|
def getWho(nick):
|
|
|
|
result = {}
|
|
|
|
for i in wholist.keys():
|
|
|
|
for x in wholist[i].keys():
|
|
|
|
if nick.lower() == x.lower():
|
|
|
|
if not i in result.keys():
|
|
|
|
result[i] = []
|
|
|
|
result[i].append(wholist[i][x])
|
|
|
|
return result
|