def main(args, app): for trigger in Trigger.FromConfig(app.config): if args.name == trigger.name: trigger.remove(app.config) app.config.save() print 'removed', trigger.format_url() break
def main (args, app): for trigger in Trigger.FromConfig(app.config): if args.name == trigger.name: with SystemBus( ) as bus: path = PATH + '/EventSink/{name:s}'.format(name=trigger.name) event = bus.get(BUS, path) event.Fire( ) props = event.GetAll(OWN_IFACE) print props
def main (args, app): wait = WaitApp( ) for trigger in Trigger.FromConfig(app.config): if args.name == trigger.name: with SystemBus( ) as bus: path = PATH + '/EventSink/{name:s}'.format(name=trigger.name) event = bus.get(BUS, path) props = event.GetAll(OWN_IFACE) print props wait.until(event, timeout=args.seconds) if wait.expired: sys.exit(2)
def get_trigger_map(conf): triggers = {} for trigger in Trigger.FromConfig(conf): triggers[trigger.name] = trigger return triggers