mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Changed some mircColor stuff.
This commit is contained in:
parent
7c34d8b449
commit
5644c8da57
@ -261,15 +261,15 @@ class Relay(callbacks.Privmsg):
|
||||
|
||||
def _formatPrivmsg(self, nick, abbreviation, msg):
|
||||
# colorize nicks
|
||||
color_index = (hash(nick) % 14) + 2
|
||||
color = ircutils._colors.keys()[color_index]
|
||||
colorNumber = (hash(nick) % 14) + 2
|
||||
if ircmsgs.isAction(msg):
|
||||
return '* %s@%s %s' % \
|
||||
(ircutils.mircColor(nick, color), abbreviation,
|
||||
(ircutils.mircColor(nick, colorNumber), abbreviation,
|
||||
ircmsgs.unAction(msg))
|
||||
else:
|
||||
return '<%s@%s> %s' % \
|
||||
(ircutils.mircColor(nick, color), abbreviation, msg.args[1])
|
||||
(ircutils.mircColor(nick, colorNumber),
|
||||
abbreviation, msg.args[1])
|
||||
|
||||
def doPrivmsg(self, irc, msg):
|
||||
callbacks.Privmsg.doPrivmsg(self, irc, msg)
|
||||
|
@ -217,9 +217,11 @@ mircColors = {
|
||||
'light grey': '15',
|
||||
}
|
||||
|
||||
# Now add the reverse to the dictionary.
|
||||
for (k, v) in mircColors.items():
|
||||
mircColors[int(v)] = k
|
||||
if v: # Ignore empty string for None.
|
||||
i = int(v)
|
||||
mircColors[v] = i
|
||||
mircColors[i] = i
|
||||
|
||||
def mircColor(s, fg=None, bg=None):
|
||||
"""Returns s, with the appropriate mIRC color codes applied."""
|
||||
|
Loading…
Reference in New Issue
Block a user