Beispiel #1
0
def init():
    # Config.show_keep_alive_after_idle = 1
    Config = Factory.get('Config')
    Lang = Factory.get('Translation')
    try:
        Config.printSettings()
        Db.init()

        if not ServerControl.is_server_running():
            out(Lang.get('server_not_running'))
            ServerControl.start_server()

        custom_import(Config.events_config,'events') #Load events

        Rcon.init(Config.rcon_host, Config.rcon_port, Config.query_port, Config.rcon_password, Config.rcon_socket_timeout)

        InputHandler.init() #Activate listening for terminal input

        #custom_import(Config.events_config,'input') #Load terminal input configuration
        custom_import(Config.tasks_config,'tasks') #Load tasks

        # Prevent threads from dying due to early main completed execution.
        while True:
            if Storage.terminate_application is True:
                exit()
            time.sleep(1)  # Important part of not being a CPU hog.

    except KeyboardInterrupt:
        Storage.terminate_application = True
Beispiel #2
0
def init():
    # Config.show_keep_alive_after_idle = 1
    Config = Factory.get('Config')
    Lang = Factory.get('Translation')
    try:
        Config.printSettings()
        Db.init()

        if not ServerControl.is_server_running():
            out(Lang.get('server_not_running'))
            ServerControl.start_server()

        custom_import(Config.events_config, 'events')  #Load events

        Rcon.init(Config.rcon_host, Config.rcon_port, Config.query_port,
                  Config.rcon_password, Config.rcon_socket_timeout)

        InputHandler.init()  #Activate listening for terminal input

        #custom_import(Config.events_config,'input') #Load terminal input configuration
        custom_import(Config.tasks_config, 'tasks')  #Load tasks

        # Prevent threads from dying due to early main completed execution.
        while True:
            if Storage.terminate_application is True:
                exit()
            time.sleep(1)  # Important part of not being a CPU hog.

    except KeyboardInterrupt:
        Storage.terminate_application = True
Beispiel #3
0
 def process_input(cls,event):
     GUI = Factory.get('GUI')
     from ark.input_handler import InputHandler
     if InputHandler.handle_input(GUI.command.get()):
         GUI.command.delete(0,END)