#!/usr/bin/env python3

import os.path
import shlex
from subprocess import check_output

def print_data(key, value):
    print("{}: {}".format(key, value))

def main():
    keys = {'Manufacturer': 'vendor',
            'Model': 'product',
            'Version': 'version'}

    cmd = "lshw -C system"

    out = check_output(shlex.split(cmd), 
                          universal_newlines = True)
    output = out.split('\n')
    
    data = {}
    for key in keys:
        for line in output:
            if keys[key] in line:
                data[key] = line.split(':')[1].strip()
                break
            else:
                data[key] = "NOT FOUND"

    for key in data:
        print_data(key, data[key])

if __name__ == "__main__":
    raise SystemExit(main())

