@@ -42,13 +42,16 @@ def update_pypi(project):
42
42
43
43
44
44
def update_github (project ):
45
-
46
45
github_api , project_stub = parse_github_url (project .github_url )
47
46
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