mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Bugfix in mircColor.
This commit is contained in:
parent
c6a8cebc2d
commit
ad3fb443a6
@ -225,6 +225,7 @@ 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."""
|
||||||
if fg is None and bg is None:
|
if fg is None and bg is None:
|
||||||
return s
|
return s
|
||||||
|
if fg is None or isinstance(fg, str):
|
||||||
fg = mircColors[fg]
|
fg = mircColors[fg]
|
||||||
if bg is None:
|
if bg is None:
|
||||||
return '\x03%s%s\x03' % (fg, s)
|
return '\x03%s%s\x03' % (fg, s)
|
||||||
@ -233,6 +234,8 @@ def mircColor(s, fg=None, bg=None):
|
|||||||
bg = mircColors[bg]
|
bg = mircColors[bg]
|
||||||
return '\x03%s,%s%s\x03' % (fg, bg, s)
|
return '\x03%s,%s%s\x03' % (fg, bg, s)
|
||||||
|
|
||||||
|
def canonicalColor(s):
|
||||||
|
return mircColor(s, hash(s) % 14 + 2)
|
||||||
|
|
||||||
def isValidArgument(s):
|
def isValidArgument(s):
|
||||||
"""Returns if s is strictly a valid argument for an IRC message."""
|
"""Returns if s is strictly a valid argument for an IRC message."""
|
||||||
|
Loading…
Reference in New Issue
Block a user