0
|
1 urlmatch
|
|
2 ========
|
|
3
|
|
4 Test making a basic tree::
|
|
5
|
|
6 >>> urlmatcher = URLmatcher()
|
|
7 >>> urls = ['http://example.com/foo/bar.html',
|
|
8 ... 'http://example.com/foo/baz.html',
|
|
9 ... 'http://example.com/foo/fleem.html']
|
|
10 >>> urlmatcher.add(*urls)
|
|
11 >>> urlmatcher.tree()
|
|
12 ['http://example.com/foo/': ['bar.html', 'baz.html', 'fleem.html']]
|
|
13
|
|
14 Now a more complex tree::
|
|
15
|
|
16 >>> urlmatcher = URLmatcher()
|
|
17 >>> urlmatcher.add(*['http://example.com/index.html',
|
|
18 ... 'https://example.com/,
|
|
19 ... 'http://gitcub.com/k0s'])
|
|
20 >>> urlmatcher.tree()
|
|
21 ['example.com': ['
|