예제 #1
0
def init():
    try:
        pygame.mixer.init(MIXER_FREQUENCY)
    except:
        print "Failed to initialize sound system"
        import debug
        print debug.get_traceback()
예제 #2
0
파일: audio.py 프로젝트: MySheep/Archy
def init():
    try:
        pygame.mixer.init(MIXER_FREQUENCY)
    except:
        print "Failed to initialize sound system"
        import debug
        print debug.get_traceback()
예제 #3
0
def run_archy():
    process_command_line_arguments()

    import debug
    debug_log = debug.DebugLog('log/debug.log')
    debug_log.install()

    import time
    print "---- Archy session started %s ----" % time.ctime()
    print debug.get_system_info()
    init_fundamentals()

    try:
        main()
    except SystemExit:
        # Archy exited gracefully.
        shutdownServiceThreads()
    except:
        print "---- Abnormal Archy termination ----"
        # Archy exited abnormally.
        shutdownServiceThreads()

        # TODO: We might want to implement a more "graceful" abnormal exit, such as informing the user that a fatal error occurred.
        import debug
        tb_info = debug.get_traceback()
        print tb_info
        debug.report_bug("Abnormal Archy termination", tb_info)

    import platform_specific
    platform_specific.shutdown_hook()

    print "---- Archy session ended %s ----" % time.ctime()
    debug_log.uninstall()
예제 #4
0
파일: pygame_run.py 프로젝트: MySheep/Archy
def run_archy():
    process_command_line_arguments()

    import debug
    debug_log = debug.DebugLog('debug.log')
    debug_log.install()

    import time
    print "---- Archy session started %s ----" % time.ctime()
    print debug.get_system_info()
    init_fundamentals()

    try:
        main()
    except SystemExit:
        # Archy exited gracefully.
        shutdownServiceThreads()
    except:
        print "---- Abnormal Archy termination ----"
        # Archy exited abnormally.
        shutdownServiceThreads()

        # TODO: We might want to implement a more "graceful" abnormal exit, such as informing the user that a fatal error occurred.
        import debug
        tb_info = debug.get_traceback()
        print tb_info
        debug.report_bug("Abnormal Archy termination", tb_info)

    import platform_specific
    platform_specific.shutdown_hook()

    print "---- Archy session ended %s ----" % time.ctime()
    debug_log.uninstall()
예제 #5
0
        try:
            archyState.commandHistory.executeCommand(command)
            if clearDisplay:
                messages.hide()
        except SystemExit:
            raise
        except commands.AbortCommandException, e:
            messages.hide()
            messages.queue("%s: %s" % (command.name(), e.getExplanation()))
            messages.display()
        except:
            import debug

            error_name = "Command %s did not run properly." % command.name()
            print error_name
            tb_info = debug.get_traceback()
            debug.report_bug(error_name, tb_info)

            messages.hide()
            messages.queue(error_name)
            messages.display()

    def runCommand(self, command):
        commands.save_and_load.saveChanges()
        self._executeCommand(command, clearDisplay=1)
        archyState.commandHistory.setLastCommand(command)

    def runLastCommand(self):
        lastCommand = archyState.commandHistory.getLastCommand()
        if lastCommand == None:
            return