Пример #1
0
    maximized = False
if str(program_settings.read_setting("fullscreen")) == "true":
    fullscreen = True
else:
    fullscreen = False
width = int(program_settings.read_setting("width"))
height = int(program_settings.read_setting("height"))

program_php = PHP()
program_gui = GUI()

if program_php.found(php_path):
    if program_php.valid(php_path):
        program_php.start_server_in_a_thread(php_path, port, webroot)
        if wait_time:
            print("Going to delay the execution by %s seconds" % wait_time)
            program_settings.pause_execution(wait_time)
        program_gui.show_browser(maximized, fullscreen, width, height, port)
        program_php.stop_server_in_a_thread()
    else:
        program_gui.show_error(
            "PHP Version is Invalid",
            "This Version of PHP is Not Supported: <bt>%s" %
            str(program_php.get_version(php_path)))
else:
    program_gui.show_error(
        "PHP Path is Invalid",
        "System could not find PHP at the specified path: %s "
        "<br><br>Current Working Directory: %s"
        "<br><br>Script Location: %s" % (php_path, os.getcwd(), program_path))
Пример #2
0
wait_time = int(program_settings.read_setting("wait_time"))
if str(program_settings.read_setting("maximized")) == "true":
    maximized = True
else:
    maximized = False
if str(program_settings.read_setting("fullscreen")) == "true":
    fullscreen = True
else:
    fullscreen = False
width = int(program_settings.read_setting("width"))
height = int(program_settings.read_setting("height"))

program_php = PHP()
program_gui = GUI()

if program_php.found(php_path):
    if program_php.valid(php_path):
        program_php.start_server_in_a_thread(php_path, port, webroot)
        if wait_time:
            print "Going to delay the execution by %s seconds" % wait_time
            program_settings.pause_execution(wait_time)
        program_gui.show_browser(maximized, fullscreen, width, height, port)
        program_php.stop_server_in_a_thread()
    else:
        program_gui.show_error("PHP Version is Invalid", "This Version of PHP is Not Supported")
else:
    program_gui.show_error("PHP Path is Invalid", "System could not find PHP at the specified path: %s "
                                                  "<br><br>Current Working Directory: %s"
                                                  "<br><br>Script Location: %s"
                          % (php_path, os.getcwd(), program_path))