Mercurial > hg > urlmatch
diff urlmatch.py @ 7:ef0553c4bbcd
more stubbing
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 27 Jun 2011 11:07:38 -0700 |
parents | 0cd69fa6751c |
children | b02420253bfd |
line wrap: on
line diff
--- 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: