summaryrefslogtreecommitdiffstats
path: root/Reaktor/IRC/asybot.py
diff options
context:
space:
mode:
authorYour Name <you@example.com>2013-05-03 23:44:58 +0200
committerYour Name <you@example.com>2013-05-03 23:44:58 +0200
commitbdc1e03a956e560ab3373436bc54d119efeb5086 (patch)
treec476636a62950a9303d3d55ae9f903a3584dc940 /Reaktor/IRC/asybot.py
parentab9954b0418e7473debd7fd311ed0c86bd599d59 (diff)
parentbb2c3ab8682316583e6866200678494965f81719 (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'Reaktor/IRC/asybot.py')
-rwxr-xr-xReaktor/IRC/asybot.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Reaktor/IRC/asybot.py b/Reaktor/IRC/asybot.py
index df758ed6..2cb533ea 100755
--- a/Reaktor/IRC/asybot.py
+++ b/Reaktor/IRC/asybot.py
@@ -2,7 +2,7 @@
#
# //Reaktor/IRC/asybot.py
#
-
+from translate_colors import translate_colors
def is_executable(x):
import os
return os.path.exists(x) and os.access(x, os.X_OK)
@@ -24,6 +24,9 @@ formatter = logging.Formatter( '%(filename)s: %(levelname)s: %(message)s')
hdlr.setFormatter(formatter)
log.addHandler(hdlr)
+# s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g -- removes color codes
+
+
class asybot(asychat):
def __init__(self, server, port, nickname, targets, **kwargs):
asychat.__init__(self)
@@ -110,6 +113,7 @@ class asybot(asychat):
def PRIVMSG(text):
for line in self.wrapper.wrap(text):
msg = 'PRIVMSG %s :%s' % (','.join(params), line)
+ log.info(msg)
self.push(msg)
sleep(1)
@@ -151,7 +155,7 @@ class asybot(asychat):
return
pid = p.pid
for line in iter(p.stdout.readline,""):
- PRIVMSG(line)
+ PRIVMSG(translate_colors(line))
log.debug('%s stdout: %s' % (pid, line))
p.wait()
elapsed = time() - start