'Find the correct handler method given the path info from the HTTP request.'

def match_pattern(self, pattern_handlers):

    path = urlparse.urlparse(self.path).path
    for pattern in pattern_handlers:
        match = re.match(pattern, path)
        if match:
            pattern_handlers[pattern](**match.groupdict())
            return True
    return None
