import os
import time

from rich.console import Console

class Main:
    c = Console()
    s = "green on black"
    es = "red on white"
    ses = "yellow on black"
    ss = "green on blue"
    
    def com_prog_exit(self):
        exit()


    def com_file_info(self):
        c = Console()
        ss = "green on blue"
        file_info_inp = c.input("[green on black]File name>>>")
        c.print(f"Path: {os.path.abspath(file_info_inp)}", style = ss)
        c.print(f"Size: {os.path.getsize(file_info_inp)}", style = ss)


def main():
    c = Console()
    s = "green on black"
    es = "red on white"
    ses = "yellow on black"
    ss = "green on blue"
    m = Main()
    
    if os.path.exists("LOG"):
        c.print("Folder LOG using", style = ss)
    else:
        os.mkdir("LOG")
        c.print("Folder LOG created", style = s)
        c.print("Folder LOG using", style = ss)
    
    while 1:
        c.print(f"ID of process: [white]{os.getpid()}[/white]", style = s)
        usr_inp = c.input(f"[green on black]{time.ctime()}>{os.getlogin()}>{os.getcwd()}>>>")
        if usr_inp == "exit":
            m.com_prog_exit()
        elif usr_inp == "file_info":
            m.com_file_info()

if __name__ == "__main__":
    main()
