Commits

Anonymous committed 311fd50 Merge

merge at-at fix

  • Participants
  • Parent commits 8e0f06c, 7df173b

Comments (0)

Files changed (1)

 
     >>> x=[]; descElt(lambda(s): x.append(s), 'td', \
     'KCI SHUTTLE'); ''.join(x)
-    '<td>KCI SHUTTLE</td>'
+    "<td class='summary'>KCI SHUTTLE</td>"
 
     Hmm... currently, we use python lists at one level,
     and XHTML markup at another, just like we used to
     >>> citySt('BP OIL@DUBLIN, OH 43016')
     ('BP OIL', 'DUBLIN', 'OH', '43016')
 
+    >>> citySt('@@listing fees???')
+    Traceback (most recent call last):
+        ...
+    IndexError: no city/state found
+
     todo: 'USPS 1983579556 SHAWNEE MISSI KS'
     """
 
     postcode = None
 
-    if '@' in desc:
+    if '@' in desc and '@@' not in desc:
 	fn, where = desc.split('@')
 
 	# 3 letter code: airport
-	if sre.match(r'[A-Z][A-Z][A-Z]', where):
-	    raise IndexError
+	if sre.match(r'^[A-Z][A-Z][A-Z]$', where):
+	    raise IndexError, "airport code not expected"
 
 	fn = fn.strip()
 	city, st = where.split(',')
 	    return desc[:m.start(0)].strip(), \
 		m.group('locality'), st, postcode
 
-    raise IndexError
+    raise IndexError, "no city/state found"
 
 
 
 def _parity(ymd):
     """
-    >>> parity("2005-11-12")
+    >>> _parity("2005-11-12")
     'even'
-    >>> parity("2005-11-13")
+    >>> _parity("2005-11-13")
     'odd'
     """
     parity = int(ymd[-1]) % 2