Fix unicode problems with overview-by-date

This commit is contained in:
Eli Ribble 2015-08-27 14:46:04 -06:00
parent 1e23eb024e
commit 9f70876576
1 changed files with 4 additions and 2 deletions

View File

@ -31,6 +31,7 @@ def _get_commit_count(repo, start, end, my_email):
'--before={}'.format(end.isoformat())] '--before={}'.format(end.isoformat())]
LOGGER.debug(" ".join(command)) LOGGER.debug(" ".join(command))
output = subprocess.check_output(command) output = subprocess.check_output(command)
output = output.decode('utf-8')
lines = output.split('\n') lines = output.split('\n')
total = len(lines) if output else 0 total = len(lines) if output else 0
my_lines = [line for line in lines if my_email in line] my_lines = [line for line in lines if my_email in line]
@ -84,7 +85,8 @@ def _count_tests(repo):
LOGGER.debug(" ".join(command)) LOGGER.debug(" ".join(command))
try: try:
output = subprocess.check_output(command, stderr=subprocess.STDOUT) output = subprocess.check_output(command, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError: output = output.decode('utf-8')
except subprocess.CalledProcessError as e:
LOGGER.info("Failed to call py.test for %s", repo) LOGGER.info("Failed to call py.test for %s", repo)
return 0 return 0
count = 0 count = 0
@ -126,7 +128,7 @@ def main():
#LOGGER.setLevel(logging.DEBUG) #LOGGER.setLevel(logging.DEBUG)
config = teamanalysis.config.get() config = teamanalysis.config.get()
timepoint = datetime.datetime(2013, 12, 30, 0, 0, 1) timepoint = datetime.datetime(2015, 8, 1, 0, 0, 1)
now = datetime.datetime.utcnow() now = datetime.datetime.utcnow()
while timepoint < now + datetime.timedelta(days=7): while timepoint < now + datetime.timedelta(days=7):
_show_summary(timepoint, config['my_email']) _show_summary(timepoint, config['my_email'])