From 806770285847cce77af27815cfde37521b5c940f Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 19 Oct 2016 14:59:34 +0200 Subject: [PATCH] run script threaded --- TODO | 4 ++-- src/fenrir/commands/commands/subprocess.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 8c6a9781..d686d16f 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ ToDos in Priority order: - Known Bugs - Fenrir key sometimes wents crazy? + Fenrir key sometimes wents crazy? (maybe this is if fenrir key is released before other keys) gstreamer sounddriver doesnt work (i think it needs a Glib - alpine seems to have problems (southernprince) + alpine seems to have problems (just small glitches) (southernprince) For example, in screen, it just tells me bell in window, but doesn't tell me which one. (southernprince) punctuation none currently not working (southernprince) in special cases next word skipps a word, this seems to happen with some whitespaces before the first word (storm_dragon) diff --git a/src/fenrir/commands/commands/subprocess.py b/src/fenrir/commands/commands/subprocess.py index 06c039c2..411b3de9 100644 --- a/src/fenrir/commands/commands/subprocess.py +++ b/src/fenrir/commands/commands/subprocess.py @@ -7,6 +7,7 @@ from core import debug import subprocess, os from subprocess import Popen, PIPE +import _thread class command(): def __init__(self): @@ -28,6 +29,9 @@ class command(): if not os.access(self.scriptPath, os.X_OK): self.env['runtime']['outputManager'].presentText('scriptfile is not executable' , soundIcon='', interrupt=False) return + _thread.start_new_thread(self._threadRun , ()) + + def _threadRun(self): try: p = Popen(self.scriptPath , stdout=PIPE, stderr=PIPE, shell=True) stdout, stderr = p.communicate()