def inner(driver): try: q = Query() yield q.connect(eventContext, hostname, creds) driver.next() yield q.notificationQuery(wql) result = driver.next() log.info("Query sent") while 1: printSize() try: class_name = '' while 1: yield result.fetchSome(500) if not driver.next(): break log.info("Got %d items", len(driver.next())) for obj in driver.next(): obj = obj.targetinstance props = [p for p in obj.__dict__.keys() if not p.startswith('_')] if obj._class_name != class_name: class_name = obj._class_name print obj._class_name print repr(props) print repr([getattr(obj, p) for p in props]) except WError, ex: log.exception(ex) yield async_sleep(1) driver.next() q.close()
def inner(driver): try: q = Query() yield q.connect(eventContext, hostname, creds) driver.next() yield q.notificationQuery(wql) result = driver.next() log.info("Query sent") while 1: printSize() try: class_name = '' while 1: yield result.fetchSome(500) if not driver.next(): break log.info("Got %d items", len(driver.next())) for obj in driver.next(): obj = obj.targetinstance props = [ p for p in obj.__dict__.keys() if not p.startswith('_') ] if obj._class_name != class_name: class_name = obj._class_name print obj._class_name print repr(props) print repr([getattr(obj, p) for p in props]) except WError, ex: log.exception(ex) yield async_sleep(1) driver.next() q.close()
def inner(driver): try: q = Query() yield q.connect(eventContext, hostname, creds) driver.next() log.info("Query sent") yield q.query(query) result = driver.next() class_name = '' while 1: yield result.fetchSome() if not driver.next(): break for obj in driver.next(): props = [p for p in obj.__dict__.keys() if not p.startswith('_')] if obj._class_name != class_name: class_name = obj._class_name print obj._class_name print repr(props) print repr([getattr(obj, p) for p in props]) q.close() except Exception, ex: log.exception(ex)
def inner(driver): try: q = Query() yield q.connect(eventContext, hostname, creds) driver.next() log.info("Query sent") yield q.query(query) result = driver.next() class_name = '' while 1: yield result.fetchSome() if not driver.next(): break for obj in driver.next(): props = [ p for p in obj.__dict__.keys() if not p.startswith('_') ] if obj._class_name != class_name: class_name = obj._class_name print obj._class_name print repr(props) print repr([getattr(obj, p) for p in props]) q.close() except Exception, ex: log.exception(ex)