git.cweiske.de
/
errbot-exec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support äöü
[errbot-exec.git]
/
exec.py
diff --git
a/exec.py
b/exec.py
index 8efb4445e579d13f5eb841caf6f540b81a4b3cd1..c7277ba7b340b964b891ab5135ca613223640cfc 100644
(file)
--- a/
exec.py
+++ b/
exec.py
@@
-1,3
+1,4
@@
+# -*- coding: utf-8 -*-
import os
import re
import subprocess
import os
import re
import subprocess
@@
-56,19
+57,17
@@
class Exec(BotPlugin):
"""
Execute the commmand
"""
"""
Execute the commmand
"""
- for part in ("abc"):
- print "part: ", part
try:
output = subprocess.check_output(
try:
output = subprocess.check_output(
- [self.config['command'],
str(msg), str
(msg.frm)],
+ [self.config['command'],
unicode(msg.body), unicode
(msg.frm)],
stderr=subprocess.STDOUT
)
if len(output) > 0:
stderr=subprocess.STDOUT
)
if len(output) > 0:
- return
output
+ return
unicode(output, 'utf-8')
else:
return "OK\n"
except subprocess.CalledProcessError as err:
if len(err.output):
else:
return "OK\n"
except subprocess.CalledProcessError as err:
if len(err.output):
- return
err.output
+ return
unicode(err.output, 'utf-8')
else:
else:
- return "Error"
+ return "Error"