add subprcess_command for external calling
This commit is contained in:
parent
ca87c7694b
commit
227bd99fb4
29
src/fenrir/commands/commands/subprocess.py
Normal file
29
src/fenrir/commands/commands/subprocess.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Fenrir TTY screen reader
|
||||||
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
from core import debug
|
||||||
|
import subprocess, os
|
||||||
|
|
||||||
|
class command():
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
def initialize(self, environment, scriptPaht=''):
|
||||||
|
self.env = environment
|
||||||
|
self.scriptPath = scriptPath
|
||||||
|
def shutdown(self):
|
||||||
|
pass
|
||||||
|
def getDescription(self):
|
||||||
|
return 'script: '+ self.scriptPath
|
||||||
|
def run(self):
|
||||||
|
p = Popen(self.scriptPath , stdout=PIPE, stderr=PIPE, shell=True)
|
||||||
|
stdout, stderr = p.communicate()
|
||||||
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
|
if stderr != '':
|
||||||
|
self.env['runtime']['outputManager'].presentText(stdout , soundIcon='', interrupt=False)
|
||||||
|
if stdout != ''
|
||||||
|
self.env['runtime']['outputManager'].presentText(stdout , soundIcon='', interrupt=False)
|
||||||
|
def setCallback(self, callback):
|
||||||
|
pass
|
@ -17,7 +17,6 @@ class command():
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
|
Loading…
Reference in New Issue
Block a user