mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Merge pull request #1284 from GLolol/patch-1
ircutils: remove redundant str.replace calls
This commit is contained in:
commit
8b1299cf09
@ -375,7 +375,7 @@ def stripReverse(s):
|
|||||||
|
|
||||||
def stripUnderline(s):
|
def stripUnderline(s):
|
||||||
"""Returns the string s, with underlining removed."""
|
"""Returns the string s, with underlining removed."""
|
||||||
return s.replace('\x1f', '').replace('\x1F', '')
|
return s.replace('\x1f', '')
|
||||||
|
|
||||||
def stripFormatting(s):
|
def stripFormatting(s):
|
||||||
"""Returns the string s, with all formatting removed."""
|
"""Returns the string s, with all formatting removed."""
|
||||||
@ -385,7 +385,7 @@ def stripFormatting(s):
|
|||||||
s = stripReverse(s)
|
s = stripReverse(s)
|
||||||
s = stripUnderline(s)
|
s = stripUnderline(s)
|
||||||
s = stripItalic(s)
|
s = stripItalic(s)
|
||||||
return s.replace('\x0f', '').replace('\x0F', '')
|
return s.replace('\x0f', '')
|
||||||
|
|
||||||
_containsFormattingRe = re.compile(r'[\x02\x03\x16\x1f]')
|
_containsFormattingRe = re.compile(r'[\x02\x03\x16\x1f]')
|
||||||
def formatWhois(irc, replies, caller='', channel='', command='whois'):
|
def formatWhois(irc, replies, caller='', channel='', command='whois'):
|
||||||
|
Loading…
Reference in New Issue
Block a user