Changeset 22:49f704595c3b in livinglogic.python.tipimaid
- Timestamp:
- 11/26/08 18:35:29 (10 years ago)
- Author:
- Nikolas Tautenhahn <nik@…>
- Branch:
- default
- Message:
-
don't use datetime.datetime.strptime(), do ancient ugly things to keep python < 2.5 happy
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
r21
|
r22
|
|
4 | 4 | # Apache sends a SIGTERM to its piped logger when it exits - when apache is killed with -9, it doesn't send anything |
5 | 5 | |
6 | | import sys, os, datetime, errno, bisect, re, gzip, signal |
| 6 | import sys, os, datetime, errno, bisect, re, gzip, signal, time |
7 | 7 | |
8 | 8 | |
… |
… |
|
83 | 83 | def apachedate2utc(self, d): |
84 | 84 | temp = d.split() |
85 | | utcdate = datetime.datetime.strptime(temp[0], "%d/%b/%Y:%H:%M:%S") |
| 85 | utcdate = datetime.datetime(*(time.strptime(temp[0], "%d/%b/%Y:%H:%M:%S")[0:6])) # support ancient distributions with python < 2.5 |
| 86 | # utcdate = datetime.datetime.strptime(temp[0], "%d/%b/%Y:%H:%M:%S") |
86 | 87 | minsoff = int("%s%s" % (temp[1][0], temp[1][-2:])) |
87 | 88 | hrsoff = int("%s%s" % (temp[1][0], temp[1][1:3])) |