mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-07 19:49:23 +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):
|
def _formatPrivmsg(self, nick, abbreviation, msg):
|
||||||
# colorize nicks
|
# colorize nicks
|
||||||
color_index = (hash(nick) % 14) + 2
|
colorNumber = (hash(nick) % 14) + 2
|
||||||
color = ircutils._colors.keys()[color_index]
|
|
||||||
if ircmsgs.isAction(msg):
|
if ircmsgs.isAction(msg):
|
||||||
return '* %s@%s %s' % \
|
return '* %s@%s %s' % \
|
||||||
(ircutils.mircColor(nick, color), abbreviation,
|
(ircutils.mircColor(nick, colorNumber), abbreviation,
|
||||||
ircmsgs.unAction(msg))
|
ircmsgs.unAction(msg))
|
||||||
else:
|
else:
|
||||||
return '<%s@%s> %s' % \
|
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):
|
def doPrivmsg(self, irc, msg):
|
||||||
callbacks.Privmsg.doPrivmsg(self, irc, msg)
|
callbacks.Privmsg.doPrivmsg(self, irc, msg)
|
||||||
|
@ -217,9 +217,11 @@ mircColors = {
|
|||||||
'light grey': '15',
|
'light grey': '15',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Now add the reverse to the dictionary.
|
|
||||||
for (k, v) in mircColors.items():
|
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):
|
def mircColor(s, fg=None, bg=None):
|
||||||
"""Returns s, with the appropriate mIRC color codes applied."""
|
"""Returns s, with the appropriate mIRC color codes applied."""
|
||||||
|
Loading…
Reference in New Issue
Block a user