Beispiel #1
0
 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
Beispiel #2
0
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)
Beispiel #3
0
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)
Beispiel #4
0
    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
Beispiel #5
0
    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
Beispiel #6
0
 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
Beispiel #7
0
 def signal(self, sig):
     dlist = []
     for el in itervalues(self.launchers):
         d = el.signal(sig)
         dlist.append(d)
     return dlist