コード例 #1
0
    def test_list_repos(self):

        repos = ghprofile.list_repos('pedromduarte', verbose=False)

        names = [ghprofile.strip_username(r) for r in repos]

        check = [
            'apparatus3-plotgui', 'apparatus3-plotgui_wx',
            'apparatus3-report2sql', 'bragg-scattering', 'cpt-cucuta-002',
            'dipole', 'hubbard-data', 'hubbard-lda',
            'hubbard-lda2', 'hubbard-lda3', 'hubbard-lda_evap',
            'lattice_3D_ipynb', 'phase-contrast',
            'phdthesis', 'thesis-analysis',
            'thesis-hubbard', 'thesis-hubbard-lda_evap', 'thesis-lattice']
        for ch in check:
            self.assertIn(ch, names)
コード例 #2
0
 def setUp(self):
     self.repos = ghprofile.list_repos('pedromduarte', verbose=False)
コード例 #3
0
        try:
            print("deleting '_posts' directory ...")
            shutil.rmtree('_posts')
        except FileNotFoundError:
            print("'_posts' does not exist. moving on.")

    repolist = None
    if args.repolist:
        with open(args.repolist, 'r') as stream:
            repolist = yaml.load(stream)
    if repolist is not None:
        repolist = {k: v.split() for k, v in repolist.items()}
    else:
        repolist = {'toptier': [], 'contributedto': [], 'lowtier': []}

    repos = gp.list_repos(args.username, verbose=True)
    with open('gh-api-repoobj-example.txt', 'w') as fout:
        fout.write("List of keys availabe in repo object return by gh API:")
        for k in repos[0].keys():
            fout.write(k)

    RepoInfo = namedtuple('RepoInfo',
                          "title githuburl category datepushed datecreated "
                          "languages keywords summary description")

    for r in repos:
        repo_name = gp.strip_username(r)

        if repo_name in repolist['toptier']:
            category = 'toptier'
        elif repo_name in repolist['contributedto']: