Parses a variety of date formats into a 9-tuple in GMT
(dateString)
| 3354 | registerDateHandler(_parse_date_perforce) |
| 3355 | |
| 3356 | def _parse_date(dateString): |
| 3357 | '''Parses a variety of date formats into a 9-tuple in GMT''' |
| 3358 | for handler in _date_handlers: |
| 3359 | try: |
| 3360 | date9tuple = handler(dateString) |
| 3361 | if not date9tuple: continue |
| 3362 | if len(date9tuple) != 9: |
| 3363 | if _debug: sys.stderr.write('date handler function must return 9-tuple\n') |
| 3364 | raise ValueError |
| 3365 | map(int, date9tuple) |
| 3366 | return date9tuple |
| 3367 | except Exception, e: |
| 3368 | if _debug: sys.stderr.write('%s raised %s\n' % (handler.__name__, repr(e))) |
| 3369 | pass |
| 3370 | return None |
| 3371 | |
| 3372 | def _getCharacterEncoding(http_headers, xml_data): |
| 3373 | '''Get the character encoding of the XML document |
no test coverage detected