示例#1
0
文件: Restart.py 项目: CBVRT2008/Cos
def restart_os():
    try:
        Kernel.Prepare_For_shutdown()
        time.sleep(1)
        Kernel.startup()

    except AttributeError:
        Kernel.Crash("Second_Restart_Error", True)
示例#2
0
文件: Restart.py 项目: CBVRT2008/Cos
def restart():
    try:
        Kernel.Clear()
        Kernel.Prepare_For_shutdown()
        Boot.Boot()

    except AttributeError:
        Kernel.Crash("Second_Restart_Error", True)
示例#3
0
文件: Boot.py 项目: CBVRT2008/Cos
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()
示例#4
0
文件: Hotkey.py 项目: CBVRT2008/Cos
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()
示例#5
0
文件: Hotkey.py 项目: CBVRT2008/Cos
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()
示例#6
0
文件: Register.py 项目: CBVRT2008/Cos
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
示例#7
0
文件: Hotkey.py 项目: CBVRT2008/Cos
def While_Boot():
    if keyboard.is_pressed("]"):
        Kernel.OpenBootSettings()
示例#8
0
def ScreenOfDeath(Text, Error_Code):
    print(colored(str(Text), "red"), Error_Code)
    input()
    Kernel.Prepare_For_shutdown()
    Kernel.Shutdown()
示例#9
0
文件: Start.py 项目: CBVRT2008/Cos
def Start():
    Kernel.Setup()
    Kernel.startup()
示例#10
0
def CrashHandler(Custom_Errorcode, Enable_Custom_Errorcode):
    if Enable_Custom_Errorcode:
        Kernel.Crash(message, Custom_Errorcode)

    else:
        Kernel.Crash(message, Error_Code)
示例#11
0
def restart():
    Kernel.Clear()
    Kernel.Prepare_For_shutdown()
    Start.Start()
示例#12
0
def restart_os():
    time.sleep(1)
    Kernel.startup()
示例#13
0
文件: Restart.py 项目: CBVRT2008/Cos
def restart():
    Kernel.Clear()
    Kernel.Prepare_For_shutdown()
    Boot.Boot()
示例#14
0
文件: Restart.py 项目: CBVRT2008/Cos
def restart_os():
    Kernel.Prepare_For_shutdown()
    time.sleep(1)
    Kernel.startup()