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 __init__(self, threads): install(threads) pl = PluginLoader() plugins = pl.load(eager()) agent = Agent(plugins) 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()
def start(daemon=True): """ Agent main. Add recurring, time-based actions here. All actions must be subclass of L{action.Action}. """ lock = AgentLock() try: lock.acquire(0) except LockFailed, e: raise Exception('Agent already running') if daemon: daemonize(lock) try: pl = PluginLoader() plugins = pl.load(eager()) agent = Agent(plugins) agent.start() finally: lock.release() def eager(): return int(nvl(cfg.loader.eager, 0)) def usage(): """ Show usage. """ s = [] s.append('\n%sd <options>' % NAME)