summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-12-15 20:29:20 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-12-15 20:29:20 +0100
commit0b2037a67c60c860dd50f572cca34e9e0595c1e4 (patch)
treecfeb4424b2a25168dfba66b0b2a9e57fd5ca1a72 /src
parenta6b1a1d4d8dc2523d1764a55a924566591232a31 (diff)
downloadpoezio-0b2037a67c60c860dd50f572cca34e9e0595c1e4.tar.gz
poezio-0b2037a67c60c860dd50f572cca34e9e0595c1e4.tar.bz2
poezio-0b2037a67c60c860dd50f572cca34e9e0595c1e4.tar.xz
poezio-0b2037a67c60c860dd50f572cca34e9e0595c1e4.zip
Make non-remote commands work.
Diffstat (limited to 'src')
-rw-r--r--src/core.py4
-rwxr-xr-xsrc/daemon.py6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/core.py b/src/core.py
index 15126c08..3bb0436e 100644
--- a/src/core.py
+++ b/src/core.py
@@ -54,6 +54,7 @@ from keyboard import read_char
from theming import get_theme
from fifo import Fifo
from windows import g_lock
+from daemon import Executor
# http://xmpp.org/extensions/xep-0045.html#errorstatus
ERROR_AND_STATUS_CODES = {
@@ -2143,7 +2144,8 @@ class Core(object):
self.information('Could not execute [%s]: %s' % (command.strip(), e,), 'Error')
self.remote_fifo = None
else:
- pass
+ e = Executor(command.strip())
+ e.start()
def get_conversation_messages(self):
"""
diff --git a/src/daemon.py b/src/daemon.py
index f23d6b5f..b413f465 100755
--- a/src/daemon.py
+++ b/src/daemon.py
@@ -23,6 +23,10 @@ import sys
import threading
import subprocess
+import logging
+
+log = logging.getLogger(__name__)
+
class Executor(threading.Thread):
"""
Just a class to execute commands in a thread.
@@ -35,7 +39,7 @@ class Executor(threading.Thread):
self.command = command
def run(self):
- print('executing %s' % (self.command.strip(),))
+ log.info('executing %s' % (self.command.strip(),))
subprocess.call(self.command.split())
def main():