mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 15:32:19 +03:00
Context was extended about execute script
This commit is contained in:
parent
014dd0f468
commit
0c2f6892ab
1 changed files with 14 additions and 1 deletions
|
@ -37,6 +37,19 @@ class Context(object):
|
|||
def execute(self, command):
|
||||
return subprocess.Popen(command, shell=True)
|
||||
|
||||
def execute_script(self, script_path, parameters=None):
|
||||
command = []
|
||||
if script_path is not None:
|
||||
command.append(script_path)
|
||||
else:
|
||||
raise Exception('[Context] Script is required')
|
||||
|
||||
if parameters is not None:
|
||||
for p in parameters:
|
||||
command.append(p)
|
||||
|
||||
return subprocess.check_call(command)
|
||||
|
||||
def get_path(self):
|
||||
return self.config_manager.get('PLUGIN', 'pluginfolderpath')
|
||||
|
||||
|
|
Loading…
Reference in a new issue