def updateUser(): conn = MySQLdb.connect(host='127.0.0.1',user='******',passwd='******',db='github') cur = conn.cursor() with open("/Users/dreamteam/Documents/study/sonar/results/oss developer evaluation/update_star_num.csv") as seed: reader = csv.reader(seed) next(reader,None) mUsers = Users(conn,cur,1,'1','1',"2016-03-01 00:00:00") for line in reader: mUsers.getFollowerAndStar(str(line[1]))
def run(conn,cur,repo_id,repo_name,repo_fullname,deadline): try: # mIssues = Issues(conn,cur,repo_id,repo_fullname) # mIssues.get_issues(1) # mIssues.get_issue_comments(1) # mCommits = Commits(conn,cur,repo_id,repo_fullname) # mCommits.get_commits(1) # mCommits.get_commit_comments(1) mUsers = Users(conn,cur,repo_id,repo_name,repo_fullname,deadline) # # starts from 0 # mUsers.updateUsers(0) # mUsers.connectUser() mUsers.getFollowerAndStar(0) except MySQLdb.Error, e: print "Mysql Error!", e;