Exemplo n.º 1
0
def restart_os():
    try:
        Kernel.Prepare_For_shutdown()
        time.sleep(1)
        Kernel.startup()

    except AttributeError:
        Kernel.Crash("Second_Restart_Error", True)
Exemplo n.º 2
0
def restart():
    try:
        Kernel.Clear()
        Kernel.Prepare_For_shutdown()
        Boot.Boot()

    except AttributeError:
        Kernel.Crash("Second_Restart_Error", True)
Exemplo n.º 3
0
def Boot():
    DoBoot = open("Cos/Cos64/Settings/Boot.ini", "r")
    DoBootContents = DoBoot.read()
    DoBoot.close()
    if DoBootContents == "Boot=True":
        DoBootFormat = True

    else:
        DoBootFormat = False

    if DoBootFormat:
        print("Press ] to open boot-settings")
        count = 0
        while count != 500:
            Hotkey.While_Boot()
            count += 1
            time.sleep(0.00000001)
        Kernel.Setup()
        Kernel.startup()

    if not DoBootFormat:
        CrashHandler.CrashHandler()
Exemplo n.º 4
0
def SystemHotkeys():
    global toggle
    if keyboard.is_pressed("f8"):
        print("Kernel running " + str(Kernel.running))
        time.sleep(0.5)

    if keyboard.is_pressed("f3"):
        CrashHandler.CrashHandler("User_Started_Screen_Of_Death", True)

    if keyboard.is_pressed("f4"):
        Kernel.Prepare_For_shutdown()
        Kernel.Shutdown()

    if keyboard.is_pressed("f5"):
        try:
            Doc = open("Cos/doc.txt", "r")
            Doc_Contents = Doc.read()
            print(Doc_Contents)
            Doc.close()

        except FileExistsError:
            print("Could not find file")
        time.sleep(0.5)

    if keyboard.is_pressed("f2"):
        if toggle:
            toggle = False
            print("hotkey input")
            time.sleep(0.5)

        if not toggle:
            toggle = True
            print("text input")
            Kernel.Do_Input = True
        if toggle:
            Kernel.Read_Keyboard()
Exemplo n.º 5
0
def SystemHotkeys():
    global toggle
    if keyboard.is_pressed("f8"):
        print("Kernel running " + str(Kernel.running))
        time.sleep(0.5)

    if keyboard.is_pressed("f3"):
        CrashHandler.CrashHandler("User_Started_Screen_Of_Death", True)

    if keyboard.is_pressed("f2"):
        if toggle:
            toggle = False
            print("hotkey input")
            time.sleep(0.5)

        if not toggle:
            toggle = True
            print("text input")
            Kernel.Do_Input = True
        if toggle:
            Kernel.Read_Keyboard()
Exemplo n.º 6
0
def Find_In_Register(command, output):
    Register = open("Cos./Cos64/Register.reg", "r")
    Register_Contents = []
    Register_Length = 0
    for line in Register.readlines():
        Register_Contents.append(line)
        Register_Length += 1

    output = ""
    count = 0
    while count != Register_Length:
        if Register_Contents[count] == str(command) + "\n":
            output = Register_Contents[count + 1][0:-1]
            print(output)
            Kernel.Run(output)
            break
        count += 2
        if count == Register_Length:
            output = "Program location could not be found"
            print(output)
            count = Register_Length
Exemplo n.º 7
0
def While_Boot():
    if keyboard.is_pressed("]"):
        Kernel.OpenBootSettings()
Exemplo n.º 8
0
def ScreenOfDeath(Text, Error_Code):
    print(colored(str(Text), "red"), Error_Code)
    input()
    Kernel.Prepare_For_shutdown()
    Kernel.Shutdown()
Exemplo n.º 9
0
def Start():
    Kernel.Setup()
    Kernel.startup()
Exemplo n.º 10
0
def CrashHandler(Custom_Errorcode, Enable_Custom_Errorcode):
    if Enable_Custom_Errorcode:
        Kernel.Crash(message, Custom_Errorcode)

    else:
        Kernel.Crash(message, Error_Code)
Exemplo n.º 11
0
def restart():
    Kernel.Clear()
    Kernel.Prepare_For_shutdown()
    Start.Start()
Exemplo n.º 12
0
def restart_os():
    time.sleep(1)
    Kernel.startup()
Exemplo n.º 13
0
def restart():
    Kernel.Clear()
    Kernel.Prepare_For_shutdown()
    Boot.Boot()
Exemplo n.º 14
0
def restart_os():
    Kernel.Prepare_For_shutdown()
    time.sleep(1)
    Kernel.startup()