1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-07 15:04:20 +00:00

silent action #228

This commit is contained in:
Arthur Grosso
2020-05-08 15:02:59 +02:00
parent fb9410eda6
commit 43e286a638
2 changed files with 14 additions and 3 deletions

View File

@@ -21,9 +21,11 @@ class Cmd(DictParser):
"""constructor
@key: action key
@action: action string
@silent: action silent
"""
self.key = key
self.action = action
self.silent = key.startswith('_')
def execute(self, templater=None, debug=False):
"""execute the command in the shell"""
@@ -53,7 +55,10 @@ class Cmd(DictParser):
err += ' with \"{}\"'.format(args)
self.log.warn(err)
return False
self.log.sub('executing \"{}\"'.format(cmd))
if self.silent:
self.log.sub('executing silent action \"{}\"'.format(self.key))
else:
self.log.sub('executing \"{}\"'.format(cmd))
try:
ret = subprocess.call(cmd, shell=True)
except KeyboardInterrupt: