changeset 7:ef0553c4bbcd

more stubbing
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 27 Jun 2011 11:07:38 -0700
parents 0cd69fa6751c
children 64935a05afdb
files urlmatch.py
diffstat 1 files changed, 14 insertions(+), 5 deletions(-) [+]
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: