Move commands-related logic to Command and CorrectedCommand

This commit is contained in:
nvbn
2015-09-08 15:00:57 +03:00
parent 4a27595e97
commit a8dbc48fd4
8 changed files with 149 additions and 120 deletions
+1 -3
View File
@@ -9,9 +9,7 @@ def sudo_support(fn, command):
if not command.script.startswith('sudo '):
return fn(command)
result = fn(Command(command.script[5:],
command.stdout,
command.stderr))
result = fn(command.update(script=command.script[5:]))
if result and isinstance(result, six.string_types):
return u'sudo {}'.format(result)