aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2015-01-02 08:58:55 +0200
committerkongr45gpen <electrovesta@gmail.com>2015-01-02 08:58:55 +0200
commitfb1c05d783f62d2ca3a3bb71691877c2bfe2994d (patch)
tree01f77170cb8fc437931682c7dac18d7f6c98be60
parenteab2b6253a4a3a3b03bb5107d0e630ec0678ea5e (diff)
downloadsupybot_github-fb1c05d783f62d2ca3a3bb71691877c2bfe2994d.tar.gz
supybot_github-fb1c05d783f62d2ca3a3bb71691877c2bfe2994d.tar.bz2
supybot_github-fb1c05d783f62d2ca3a3bb71691877c2bfe2994d.zip
Use the stripFormatting() method provided by supybot's ircutils
-rw-r--r--local/testing/ExpectationPluginTestCase.py7
-rw-r--r--local/utility.py5
2 files changed, 3 insertions, 9 deletions
diff --git a/local/testing/ExpectationPluginTestCase.py b/local/testing/ExpectationPluginTestCase.py
index 9027927..27194c2 100644
--- a/local/testing/ExpectationPluginTestCase.py
+++ b/local/testing/ExpectationPluginTestCase.py
@@ -1,4 +1,5 @@
###
+from supybot.ircutils import stripFormatting
from supybot.log import info
from supybot.test import *
@@ -10,8 +11,6 @@ from time import sleep
import re
import urllib
-from ..utility import clean
-
class ExpectationPluginTestCase(PluginTestCase):
plugins = {}
@@ -86,7 +85,7 @@ def expect(query):
def it():
return Expectation()
-class Expectation:
+class Expectation(object):
def __init__(self):
self.error = ''
self.negation = False
@@ -107,7 +106,7 @@ class Expectation:
return other
def cleanReply(self):
- return clean(self.reply)
+ return ircutils.stripFormatting(self.reply)
def getSummary(self):
if self.assertionParameter:
diff --git a/local/utility.py b/local/utility.py
index 1b7c3e4..20802b8 100644
--- a/local/utility.py
+++ b/local/utility.py
@@ -91,11 +91,6 @@ def saveMessages(msgs):
return
globals.messageList = msgs
-def clean(string):
- """Strips IRC control characters from a string"""
- regex = re.compile("(([\x02\x1f\x16\x0f])|(\x03(?:\d{1,2}(?:,\d{1,2})?)?))", re.UNICODE)
- return regex.sub('', string)
-
def isYes(string):
"""Returns True if the string represents a yes, False, if it represents
no, and another string if it represents something else"""

© 2014-2024 Faster IT GmbH | imprint | privacy policy