diff urlmatch.txt @ 0:8bd0c3b2163e

create urlmatch package
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 13 Jun 2011 21:25:06 -0700
parents
children 64935a05afdb
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/urlmatch.txt	Mon Jun 13 21:25:06 2011 -0700
@@ -0,0 +1,21 @@
+urlmatch
+========
+
+Test making a basic tree::
+
+    >>> urlmatcher = URLmatcher()
+    >>> urls = ['http://example.com/foo/bar.html',
+    ...         'http://example.com/foo/baz.html',
+    ...         'http://example.com/foo/fleem.html']
+    >>> urlmatcher.add(*urls)
+    >>> urlmatcher.tree()
+    ['http://example.com/foo/': ['bar.html', 'baz.html', 'fleem.html']]
+    
+Now a more complex tree::
+
+    >>> urlmatcher = URLmatcher()
+    >>> urlmatcher.add(*['http://example.com/index.html',
+    ...                  'https://example.com/,
+    ...                  'http://gitcub.com/k0s'])
+    >>> urlmatcher.tree()
+    ['example.com': ['