Conditions | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 11 |
Ratio | 91.67 % |
Changes | 0 |
1 | import os |
||
52 | def execute(self): |
||
53 | """Execute a system command.""" |
||
54 | if self._decode_output: |
||
55 | # Capture and decode system output |
||
56 | with Popen(self.command, shell=True, stdout=PIPE) as process: |
||
57 | self._output = [i.decode("utf-8").strip() for i in process.stdout] |
||
58 | self._success = True |
||
59 | else: |
||
60 | # Execute without capturing output |
||
61 | os.system(self.command) |
||
62 | self._success = True |
||
63 | return self |
||
64 |