예제 #1
0
def daemon_mode(config_path):
    try:
        twit = Daemon(config_path, log=False)
        twit.spawn_watchers()
        twit.spawn_tweet_thread()
        twit.spawn_retweet_thread()
        interface = CursesInterface(twit)
        interface.run()
        while active_count() > 0:
            try:
                sleep(1)
            except Exception as e:
                twit.log_handler.emit(e, rec_type='error')
                sleep(1)
    except KeyboardInterrupt:
        exit()