def collect_topics():
topic_dict = dict()
app.logger.debug("Inside Collected Topics - Number of connected clients: " + str(len(client_dict)))
for sid in client_dict.keys():
for interest in client_dict[sid].keys():
for region in client_dict[sid][interest].keys():
if client_dict[sid][interest][region][0]:
topic = interest + '_' + region
try:
if client_dict[sid][interest][region][1] < topic_dict[topic]:
topic_dict[topic] = client_dict[sid][interest][region][1]
except KeyError:
topic_dict[topic] = client_dict[sid][interest][region][1]
app.logger.debug("Topic Dict: " + str(topic_dict))
return topic_dict
评论列表
文章目录