aboutsummaryrefslogtreecommitdiffstats
path: root/local/utility.py
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2014-04-28 19:07:21 +0300
committerkongr45gpen <electrovesta@gmail.com>2014-04-28 19:07:21 +0300
commit4665d27418eb4a426f6ff52352285d6430ba0841 (patch)
tree30901457e418f1f2e4c866f32f13782a31a14273 /local/utility.py
parentac155dc4e25a6c91d36d9c7b5f8bed9aacbb426c (diff)
downloadsupybot_github-4665d27418eb4a426f6ff52352285d6430ba0841.tar.gz
supybot_github-4665d27418eb4a426f6ff52352285d6430ba0841.tar.bz2
supybot_github-4665d27418eb4a426f6ff52352285d6430ba0841.zip
Make tests look Rubyish
Diffstat (limited to 'local/utility.py')
-rw-r--r--local/utility.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/local/utility.py b/local/utility.py
index 2640e41..2ae1491 100644
--- a/local/utility.py
+++ b/local/utility.py
@@ -1,3 +1,4 @@
+import re
import urllib2
import supybot.conf as conf
@@ -71,6 +72,11 @@ def saveMessages(msgs):
return
globals.messageList = msgs
+def clean(string):
+ """Strips IRC control characters from a string"""
+ regex = re.compile("((\x02)|(\x03))(?:\d{1,2}(?:,\d{1,2})?)?", re.UNICODE)
+ return regex.sub('', string)
+
# Possible colours:
# white, black, (light/dark) blue, (light) green, red, brown, purple,
# orange, yellow, teal, pink, light/dark gray/grey

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