Mercurial > public > sg101
comparison tools/translate_yahoo_group.py @ 320:66cc2f8c4603
Removed a raise of CommandError, which was left over from when this code started life as a Django management command.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 08 Feb 2011 03:53:10 +0000 |
parents | c5055573e8d7 |
children |
comparison
equal
deleted
inserted
replaced
319:c5055573e8d7 | 320:66cc2f8c4603 |
---|---|
101 """ | 101 """ |
102 Converts the timestamp string of the form "yyyy-mm-ddTHH:MM:SSZ" into a | 102 Converts the timestamp string of the form "yyyy-mm-ddTHH:MM:SSZ" into a |
103 datetime object. | 103 datetime object. |
104 """ | 104 """ |
105 m = DATE_RE.match(s) | 105 m = DATE_RE.match(s) |
106 if m is None: | 106 assert m is not None |
107 raise CommandError("Invalid date string: %s" % s) | |
108 | 107 |
109 parts = [int(part) for part in m.groups()] | 108 parts = [int(part) for part in m.groups()] |
110 return datetime.datetime(year=parts[0], month=parts[1], day=parts[2], | 109 return datetime.datetime(year=parts[0], month=parts[1], day=parts[2], |
111 hour=parts[3], minute=parts[4], second=parts[5]) | 110 hour=parts[3], minute=parts[4], second=parts[5]) |
112 | 111 |