Stop using prevent_highlight. it ruins terminals on OS X
This commit is contained in:
parent
dc17ef7bb9
commit
f715e46155
3 changed files with 8 additions and 10 deletions
|
@ -158,8 +158,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
:help: Show the top 10 richest users
|
:help: Show the top 10 richest users
|
||||||
"""
|
"""
|
||||||
top_10 = utils.top_10(self._all_coins(event["server"]),
|
top_10 = utils.top_10(self._all_coins(event["server"]),
|
||||||
convert_key=lambda nickname: utils.prevent_highlight(
|
convert_key=lambda nickname:
|
||||||
event["server"].get_user(nickname).nickname),
|
event["server"].get_user(nickname).nickname,
|
||||||
value_format=lambda value: self._coin_str_human(value))
|
value_format=lambda value: self._coin_str_human(value))
|
||||||
event["stdout"].write("Richest users: %s" % ", ".join(top_10))
|
event["stdout"].write("Richest users: %s" % ", ".join(top_10))
|
||||||
|
|
||||||
|
|
|
@ -114,10 +114,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
user_stats[nickname] = 0
|
user_stats[nickname] = 0
|
||||||
user_stats[nickname] += value
|
user_stats[nickname] += value
|
||||||
|
|
||||||
nick_func = lambda nickname: utils.prevent_highlight(
|
top_10 = utils.top_10(user_stats,
|
||||||
server.get_user(nickname).nickname)
|
convert_key=lambda nickname: server.get_user(nickname).nickname)
|
||||||
|
|
||||||
top_10 = utils.top_10(user_stats, convert_key=nick_func)
|
|
||||||
return "Top duck %s%s: %s" % (description, channel_query_str,
|
return "Top duck %s%s: %s" % (description, channel_query_str,
|
||||||
", ".join(top_10))
|
", ".join(top_10))
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
items = [(word_user[0], word_user[1]) for word_user in word_users]
|
items = [(word_user[0], word_user[1]) for word_user in word_users]
|
||||||
word_users = dict(items)
|
word_users = dict(items)
|
||||||
top_10 = utils.top_10(word_users,
|
top_10 = utils.top_10(word_users,
|
||||||
convert_key=lambda nickname: utils.prevent_highlight(
|
convert_key=lambda nickname:
|
||||||
event["server"].get_user(nickname).nickname))
|
event["server"].get_user(nickname).nickname)
|
||||||
event["stdout"].write("Top '%s' users: %s" % (word,
|
event["stdout"].write("Top '%s' users: %s" % (word,
|
||||||
", ".join(top_10)))
|
", ".join(top_10)))
|
||||||
else:
|
else:
|
||||||
|
@ -130,7 +130,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
user_words[nickname] += word_count
|
user_words[nickname] += word_count
|
||||||
|
|
||||||
top_10 = utils.top_10(user_words,
|
top_10 = utils.top_10(user_words,
|
||||||
convert_key=lambda nickname: utils.prevent_highlight(
|
convert_key=lambda nickname:
|
||||||
event["server"].get_user(nickname).nickname))
|
event["server"].get_user(nickname).nickname)
|
||||||
event["stdout"].write("wordiest%s: %s" % (
|
event["stdout"].write("wordiest%s: %s" % (
|
||||||
word_prefix, ", ".join(top_10)))
|
word_prefix, ", ".join(top_10)))
|
||||||
|
|
Loading…
Reference in a new issue