import json
from properties import GitHubAuthToken, dataFolderPath, gitExecutablePath, verbose, packageFolderPath
from downloader.githubdownloader import GithubDownloader
from datamanager.filemanager import FileManager

'''
Here I download the profile links of the users that have more than ten public repos and more than 20 followers. 
These users will be used to do the benchmarking
'''

ghd = GithubDownloader(GitHubAuthToken)
fm = FileManager()
users = "https://api.github.com/search/users?q=repos:10+followers:20"
logins = []
final_list = []

for user in ghd.download_paginated_object(users):
    logins.append(user["html_url"])



for item in logins:
	name = '_'.join(item.split('/')[-1:])
	try:
		stats = fm.read_json_from_file(dataFolderPath + "/" + name + "/user_stats.json")
		if stats["commit_authored"]>100:
			final_list.append(item)
	except:
		continue
import sys
import traceback
import requests
import json
from logger.downloadlogger import Logger
from datamanager.dbmanager import DBManager
from datamanager.filemanager import FileManager
from downloader.gitdownloader import GitDownloader
from downloader.githubdownloader import GithubDownloader
#from list_of_repos_urls import List_of_repos_urls
from properties import GitHubAuthToken, dataFolderPath, gitExecutablePath, verbose

fm = FileManager()
db = DBManager()
lg = Logger(verbose)
ghd = GithubDownloader(GitHubAuthToken)
gd = GitDownloader(gitExecutablePath, lg)

'''
Haven't implemented checking if comments exist already nor step_action.
This e
'''

#user_api_address = "https://api.github.com/users/" + '/'.join(user_address.split('/')[-1:])
#user_name = '_'.join(user_address.split('/')[-1:])
user_name = "nbriz"

db.initialize_write_to_disk(user_name)
project = db.read_project_from_disk(user_name)

示例#3
0
import sys
import traceback
from logger.downloadlogger import Logger
from datamanager.dbmanager import DBManager
from downloader.gitdownloader import GitDownloader
from downloader.githubdownloader import GithubDownloader
from helpers import get_number_of, print_usage, read_file_in_lines
from properties import GitHubAuthToken, dataFolderPath, gitExecutablePath, verbose, \
    download_commits_authored, download_commits_committed, download_issues_assigned, \
    download_issues_authored, download_issues_mentions, download_issues_commented, \
    download_issues_owened, download_repositories_owned, download_user_repos 

# Initialize all required objects
db = DBManager()
lg = Logger(verbose)
ghd = GithubDownloader(GitHubAuthToken)
gd = GitDownloader(gitExecutablePath, lg)

def download_user(user_address):
	"""
	Downloads all the data of a user given its GitHub URL.

	:param user_address: the URL of the user of which the data are downloaded.
	"""
	user_api_address = "https://api.github.com/users/" + '/'.join(user_address.split('/')[-1:])
	user_name = '_'.join(user_address.split('/')[-1:])

	db.initialize_write_to_disk(user_name)

	project = db.read_project_from_disk(user_name)