#!/usr/bin/python

# Console

import sys, os, time, subprocess

def MCS():
    return subprocess.Popen(['python', 'mcs.py'])

def color(text, color):
    if color == 0: color = "\033[0m"
    if color == 1: color = "\033[94m"
    if color == 2: color = "\033[92m"
    if color == 3: color = "\033[91m"
    if color == 4: color = "\033[93m"
    return color+text+"\033[0m"

def showMenu():

    print("\033[H\033[J", end="")
    print("== Music Control System v0.1 ==")
    print("=                             =")
    print("=     {}   MCS Time   {}    =".format(color("[7]",1), color("[8]",3)))
    print("=     {}   MCS Auto   {}    =".format(color("[4]",1), color("[5]",3)))
    print("=     {}   MCS EDT    {}    =".format(color("[1]",1), color("[2]",3)))
    print("=                             =")
    print("========= Informations ========")
    print("=                             =")
    print("=                             =")
    print("=                             =")
    print("===============================")

def main():

    # Old hack (TODO)
    class main:
        def poll(): return True

    while 1:

        showMenu()
        command = str(input("=> "))

        if command == '4':
            if main.poll() == None:
                main.terminate()
                main.kill()
            main = MCS()
        if command == '5':
            

        if command == 'q':
            exit(0)

if __name__ == "__main__": main()

if main.poll() == None:
                main.terminate()
                main.kill()