def wait_build(result_queue, timeout=5): """ Uses the result queue to wait for a result from the open_file() callback :param result_queue: The Queue() to get the result from :param timeout: How long to wait before considering the test a failure :return: The value from the queue """ def _send_result(package_name, event_name, payload): result_queue.put(payload.result) try: package_events.listen('Golang Build', _send_result) return result_queue.get(timeout=timeout) finally: package_events.unlisten('Golang Build', _send_result)
def __init__(self): self.observer = Observer() self.event_handler = ReportEvent() self.paths = {} self.observer.start() package_events.listen(u'FileBrowser', self.dired_event_handler)
def __init__(self): self.paths = {} self.ignore_views = set() self.scheduled_views = {} package_events.listen(u'FileBrowserWFS', self.update_paths)