Beispiel #1
0
    def with_organization_repos(repos):
        all_repos = {r['id']: r for r in repos}  # index by id
        orgs = github.get('user/orgs')
        orgs_names = [o['login'] for o in orgs]
        for org_name in orgs_names:
            org_repos = github.get('orgs/%s/repos' % org_name)
            for repo in org_repos:
                all_repos[repo['id']] = repo  # add each repo for each org.

        all_repos = all_repos.values()
        all_repos.sort(key=operator.itemgetter('full_name'))
        return all_repos
Beispiel #2
0
    def with_organization_repos(repos):
        all_repos = {r['id']: r for r in repos}  # index by id
        orgs = github.get('user/orgs')
        orgs_names = [o['login'] for o in orgs]
        for org_name in orgs_names:
            org_repos = github.get('orgs/%s/repos' % org_name)
            for repo in org_repos:
                all_repos[repo['id']] = repo  # add each repo for each org.

        all_repos = all_repos.values()
        all_repos.sort(key=operator.itemgetter('full_name'))
        return all_repos
Beispiel #3
0
 def repos():
     repos = github.get('user/repos')
     repos = with_organization_repos(repos)
     selected_ids = [r.github_id for r in g.user.repos]
     for repo in repos:
         repo['checked'] = (repo['id'] in selected_ids)
     return render_template('repos.html', repos=repos)
Beispiel #4
0
 def repos():
     repos = github.get('user/repos')
     repos = with_organization_repos(repos)
     selected_ids = [r.github_id for r in g.user.repos]
     for repo in repos:
         repo['checked'] = (repo['id'] in selected_ids)
     return render_template('repos.html', repos=repos)
Beispiel #5
0
 def get_repos():
     repos = github.get('user/repos', params=list_params)
     repos = with_organization_repos(repos)
     selected_ids = [r.github_id for r in g.user.repos]
     for repo in repos:
         repo['checked'] = (repo['id'] in selected_ids)
     # list only python projects
     repos = [r for r in repos if str(r.get('language')).lower() == 'python']
     return render_template('repos.html', repos=repos)
Beispiel #6
0
 def get_repos():
     repos = github.get('user/repos', params=list_params)
     repos = with_organization_repos(repos)
     selected_ids = [r.github_id for r in g.user.repos]
     for repo in repos:
         repo['checked'] = (repo['id'] in selected_ids)
     # list only python projects
     repos = [
         r for r in repos if str(r.get('language')).lower() == 'python'
     ]
     return render_template('repos.html', repos=repos)
Beispiel #7
0
 def get_user():
     return str(github.get('user'))
Beispiel #8
0
 def get_emails_from_github(self):
     params = {'access_token': self.github_token}
     headers = {'Accept': 'application/vnd.github.v3'}
     emails = github.get('user/emails', params=params, headers=headers)
     return [e for e in emails if e['verified']]
Beispiel #9
0
 def user():
     return str(github.get('user'))
Beispiel #10
0
 def get_emails_from_github(self):
     params = {'access_token': self.github_token}
     headers = {'Accept': 'application/vnd.github.v3'}
     emails = github.get('user/emails', params=params, headers=headers)
     return [e for e in emails if e['verified']]