'Appends the given handlers to our handler list.
Host patterns are processed sequentially in the order they were
added. All matching patterns will be considered.'

def add_handlers(self, host_pattern, host_handlers):

    if (not host_pattern.endswith('$')):
        host_pattern += '$'
    handlers = []
    if (self.handlers and (self.handlers[(-1)][0].pattern == '.*$')):
        self.handlers.insert((-1), (re.compile(host_pattern), handlers))
    else:
        self.handlers.append((re.compile(host_pattern), handlers))
    for spec in host_handlers:
        if isinstance(spec, (tuple, list)):
            assert (len(spec) in (2, 3, 4))
            spec = URLSpec(*spec)
        handlers.append(spec)
        if spec.name:
            if (spec.name in self.named_handlers):
                app_log.warning('Multiple    handlers    named    %s;    replacing    previous    value', spec.name)
            self.named_handlers[spec.name] = spec
