class TSTRouter(URLRouter): def __init__(self): self.urls = TSTree() def add(self, url, value): self.urls.set(url, value) def exact_match(self, url): return self.urls.get(url) def best_match(self, url): return self.urls.find_part(url) def match_all(self, url): results = self.urls.find_all(url) return results
class TSTRouter(URLRouter): def __init__(self): self.urls = TSTree() def add(self, key, value): self.urls.set(key, value) def match_url(self, url_to_find): return self.urls.get(url_to_find) def url_starts_with(self, url_to_find): return self.urls.find_all(url_to_find) def shortest_url(self, url_to_find): return self.urls.find_shortest(url_to_find) def longest_url(self, url_to_find): return self.urls.find_longest(url_to_find)