summaryrefslogtreecommitdiff
path: root/linaro_metrics/sync_github_changes.py
diff options
context:
space:
mode:
Diffstat (limited to 'linaro_metrics/sync_github_changes.py')
-rwxr-xr-xlinaro_metrics/sync_github_changes.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/linaro_metrics/sync_github_changes.py b/linaro_metrics/sync_github_changes.py
index 96b2aac..6050c18 100755
--- a/linaro_metrics/sync_github_changes.py
+++ b/linaro_metrics/sync_github_changes.py
@@ -7,6 +7,7 @@ import os
import re
import sys
import textwrap
+import time
import urllib2
from datetime import datetime
@@ -51,9 +52,13 @@ GITHUB_REPOS = [
class Commit(object):
- def __init__(self, sha, message):
+ def __init__(self, sha, message, author):
self.id = sha
self.message = message
+ self.commit_author = '%s <%s>' % (author['name'], author['email'])
+ dt = datetime.strptime(author['date'], '%Y-%m-%dT%H:%M:%SZ')
+ self.commit_time = int(time.mktime(dt.timetuple()))
+ self.commit_timezone = 0
def _get(url):
@@ -169,7 +174,8 @@ def repo_cache():
def create_tags(crowd, project, commits):
for commit in commits:
- c = Commit(commit['sha'], commit['commit']['message'])
+ c = Commit(
+ commit['sha'], commit['commit']['message'], commit['author'])
team_project_credit.update_commit_callback(
crowd, project, None, c, False)