def __init__(self, url, uuid, threads, auth, exchange): setup_logging() install(url, uuid, threads, auth, exchange) PluginLoader.load_all() agent = Agent() agent.start(False) while True: sleep(10) print 'Agent: sleeping...'
def __init__(self, url, queue, threads, auth, exchange): setup_logging() install(url, queue, threads, auth, exchange) PluginLoader.load_all() agent = Agent() agent.start(False) while True: sleep(10) print('Agent: sleeping...')
def start(daemon=True): """ Agent main. Add recurring, time-based actions here. All actions must be subclass of action.Action. """ lock = AgentLock() try: lock.acquire(False) except LockFailed: raise Exception('Agent already running') if daemon: start_daemon(lock) try: PluginLoader.load_all() agent = Agent() agent.start() finally: lock.release()