def engine_count(self): """determine engine count from `engines` dict""" count = 0 for n in itervalues(self.engines): if isinstance(n, (tuple, list)): n, args = n count += n return count
def validate_url_container(container): """validate a potentially nested collection of urls.""" if isinstance(container, string_types): url = container return validate_url(url) elif isinstance(container, dict): container = itervalues(container) for element in container: validate_url_container(element)
def _match(self, check): """Find all the matches for a check dict.""" matches = [] tests = {} for k,v in iteritems(check): if isinstance(v, dict): tests[k] = CompositeFilter(v) else: tests[k] = lambda o: o==v for rec in itervalues(self._records): if self._match_one(rec, tests): matches.append(copy(rec)) return matches
def _match(self, check): """Find all the matches for a check dict.""" matches = [] tests = {} for k, v in iteritems(check): if isinstance(v, dict): tests[k] = CompositeFilter(v) else: tests[k] = lambda o: o == v for rec in itervalues(self._records): if self._match_one(rec, tests): matches.append(copy(rec)) return matches
def interrupt_then_kill(self, delay=1.0): dlist = [] for el in itervalues(self.launchers): d = el.interrupt_then_kill(delay) dlist.append(d) return dlist
def signal(self, sig): dlist = [] for el in itervalues(self.launchers): d = el.signal(sig) dlist.append(d) return dlist