summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-04-05 22:41:46 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-04-05 22:41:46 +0300
commit2a9dc0247a0872cf5fb707b4518126281ac95b33 (patch)
treecaa3150fe3ce5866ec080e2586c651a18cba4d55
parent2dc00c76df28d9b223c7bf779ff0d472e18f8d0d (diff)
downloadopenembedded-core-contrib-marquiz/buildperf/git-import.tar.gz
openembedded-core-contrib-marquiz/buildperf/git-import.tar.bz2
openembedded-core-contrib-marquiz/buildperf/git-import.zip
build-perf-git-import.py: handle Mexican timezones and localemarquiz/buildperf/git-import
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xscripts/contrib/build-perf-git-import.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/scripts/contrib/build-perf-git-import.py b/scripts/contrib/build-perf-git-import.py
index 7f414af613..99f20c8207 100755
--- a/scripts/contrib/build-perf-git-import.py
+++ b/scripts/contrib/build-perf-git-import.py
@@ -92,6 +92,8 @@ class TimeZone(tzinfo):
return None
TIMEZONES = {'UTC': TimeZone(0, 'UTC'),
+ 'CST': TimeZone(-21600, 'CST'),
+ 'CDT': TimeZone(-18000, 'CDT'),
'EDT': TimeZone(-18000, 'EDT'),
'EST': TimeZone(-14400, 'EST'),
'ET': TimeZone(-14400, 'ET'),
@@ -156,19 +158,18 @@ class OutputLog(object):
# Determine timestamp format
fobj.seek(0)
line = fobj.readline()
- try:
- locale.setlocale(locale.LC_ALL, 'C')
- self._parse_line_old_default(line)
- parse_line = self._parse_line_old_default
- except ConversionError:
- parse_line = None
- if not parse_line:
+ locales = (('C', self._parse_line_old_default),
+ ('es_MX.UTF-8', self._parse_line_old_default),
+ ('ro_RO.UTF-8', self._parse_line_old_ro))
+ for loc, parse_line in locales:
try:
- locale.setlocale(locale.LC_ALL, 'ro_RO.UTF-8')
- self._parse_line_old_ro(line)
- parse_line = self._parse_line_old_ro
+ locale.setlocale(locale.LC_ALL, loc)
+ parse_line(line)
+ break
except ConversionError:
- raise ConversionError("Unable to parse output.log timestamps")
+ pass
+ if not parse_line:
+ raise ConversionError("Unable to parse output.log timestamps")
fobj.seek(0)
for line in fobj.readlines():