Skip to content

Commit d58213d

Browse files
committedMar 20, 2015
Merge pull request #21 from Python-toolshed/daily-build02
Made some changes to updater.
2 parents 85bd668 + fc1ddd6 commit d58213d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed
 

‎toolshed/updater.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ def update_pypi(project):
4242

4343

4444
def update_github(project):
45-
4645
github_api, project_stub = parse_github_url(project.github_url)
4746
github_info = requests.get(github_api).json()
48-
difference_check(project.forks_count, github_info['forks_count'])
49-
difference_check(project.starred_count, github_info['stargazers_count'])
50-
difference_check(project.watchers_count, github_info['watchers_count'])
51-
difference_check(project.last_commit, datetime.datetime.strptime(github_info['updated_at'], "%Y-%m-%dT%H:%M:%SZ"))
52-
difference_check(project.open_issues_count, github_info['open_issues_count'])
53-
contributors = requests.get(project.contributors_url).json()
54-
project.contributors_count = len(contributors)
47+
update_fields = [[project.forks_count, github_info['forks_count']],
48+
[project.starred_count, github_info['stargazers_count']],
49+
[project.watchers_count, github_info['watchers_count']],
50+
[project.last_commit, datetime.datetime.strptime(github_info['updated_at'], "%Y-%m-%dT%H:%M:%SZ")],
51+
[project.open_issues_count, github_info['open_issues_count']]]
52+
field_update = []
53+
for field in update_fields:
54+
field_update.append(difference_check(field[0], field[1]))
55+
if True in field_update:
56+
return True
57+
return False

0 commit comments

Comments
 (0)