# HG changeset patch # User Jeff Hammel # Date 1309198058 25200 # Node ID ef0553c4bbcd37a86e35c29a74068631df94b02a # Parent 0cd69fa6751c66a39db84cbb2432709b6df6de4d more stubbing diff -r 0cd69fa6751c -r ef0553c4bbcd urlmatch.py --- a/urlmatch.py Mon Jun 27 07:16:46 2011 -0700 +++ b/urlmatch.py Mon Jun 27 11:07:38 2011 -0700 @@ -58,12 +58,21 @@ continue if isinstance(url1[i], basestring): raise NotImplementedError + else: + raise NotImplementedError + elif i not in url1 and i not in url2: + continue else: - retval = url1.get(i, url2[i]) - if isinstance(retval, basestring): - return {i: retval} - return {i: retval[0]} - + retval1 = url1.get(i) + retval2 = url2.get(i) + if isinstance(retval1, basestring) or isinstance(retval2, basestring): + return {i: (retval1, retval2)} + if retval1 is not None: + retval1 = retval1[0] + if retval2 is not None: + retval2 = retval2[0] + return {i: [(retval1, retval2)]} + def match(self, url): if '://' not in url: