Externals.run()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
#!/usr/bin/python
2
# -*- coding: UTF-8 -*-
3
import subprocess
4
5
class Externals(object):
6
    """Utility that wraps the python subprocess module to start other applications
7
    """
8
9
    def run(self, command):
10
        """Start a subprocess with the command provided.
11
12
        Args:
13
            command (list): A list of command elements.
14
        """
15
        output = subprocess.check_output(command)
16
        return Result(True, output)
17
18
19
class Result(object):
20
21
    def __init__(self, succesful, output):
22
        self.succesful = succesful
23
        self.output = output
24