def main(): """ Main driver for the script """ args = parse_args() lab = args.labno due_date_time = (args.date, args.time) chk_date_time = (args.checkpt_date, args.checkpt_time) submissions_dir = config.getLabSubmissionsDir() class_tutors = config.getTutors() class_students = academicclass.Class(args.students_fn, args.pair_fn, config.getOrgName()) # class_pairs = getclass.get_pairs(args.pair_fn) # class_students = getclass.get_students(args.students_fn) clean_dir(submissions_dir) tutor_csvs = create_csvs(submissions_dir, class_tutors) dbg_log = open_dbglog(args.dbg, submissions_dir) if (args.infile_name != None): logging.info("Currently not supported") else: pull_all_students(acad_class=class_students, tutors=class_tutors, csvs=tutor_csvs, labno=lab, due=due_date_time, chk=chk_date_time, log=dbg_log) #Close all open file handles dbg_log.close() for csv_file in tutor_csvs.values(): csv_file.close()
def main(): """ Main driver for the script """ args = parse_args() lab = args.labno due_date_time = (args.date, args.time) chk_date_time = (args.checkpt_date, args.checkpt_time) submissions_dir = config.getLabSubmissionsDir() class_tutors = config.getTutors() class_students = academicclass.Class(args.students_fn, args.pair_fn, config.getOrgName()) # class_pairs = getclass.get_pairs(args.pair_fn) # class_students = getclass.get_students(args.students_fn) clean_dir(submissions_dir) tutor_csvs = create_csvs(submissions_dir, class_tutors) dbg_log = open_dbglog(args.dbg, submissions_dir) if(args.infile_name != None): logging.info("Currently not supported") else: pull_all_students(acad_class=class_students, tutors=class_tutors, csvs=tutor_csvs, labno=lab, due=due_date_time, chk=chk_date_time, log=dbg_log) #Close all open file handles dbg_log.close() for csv_file in tutor_csvs.values(): csv_file.close()
def main(del_arg): """ Main driver for archiving repos in a github repository """ class_org = config.getOrgName() labs = config.get_labs() username = raw_input("Username: ") password = getpass.getpass() credentials = (username, password) archive_solo(class_org, labs, credentials, del_arg.delrepo) archive_pairs(class_org, labs, credentials, del_arg.delrepo)
def main(del_arg): """ Main driver for archiving repos in a github repository """ class_org = config.getOrgName() labs = config.get_labs() username = raw_input("Username: ") password = getpass.getpass() credentials = (username, password) archive_solo(class_org, labs, credentials, del_arg.delrepo) archive_pairs(class_org, labs, credentials, del_arg.delrepo)
def main(): """ Main driver for deleteteam modules """ class_org = config.getOrgName() username = raw_input("Username: "******"\A(Student_)", team[0]) != None) or \ (re.search(r"\A(Pair_)", team[0]) != None): logging.info("Deleting team {0}".format(team[0])) delete_team(team, credentials)
def main(): """ Main driver for deleteteam modules """ class_org = config.getOrgName() username = raw_input("Username: "******"\A(Student_)", team[0]) != None) or \ (re.search(r"\A(Pair_)", team[0]) != None): logging.info("Deleting team {0}".format(team[0])) delete_team(team, credentials)
parser.add_argument('-u', '--githubUsername', help="github username, default is current OS user", default=getpass.getuser()) parser.add_argument( '-s', '--scratchDirName', help="scratch directory to clone repos in while doing work", default=config.getScratchRepoDir()) parser.add_argument('-t', '--teamPrefix', help="prefix of teams to create", default="") args = parser.parse_args() if not os.access(args.scratchDirName, os.W_OK): print(args.scratchDirName + " is not a writable directory.") sys.exit(1) pw = getpass.getpass() g = Github(args.githubUsername, pw, user_agent="PyGithub") org = g.get_organization(config.getOrgName()) updatePairsForLab(g, org, args.lab, args.scratchDirName, args.teamPrefix) sys.exit(0)
from github import GithubException defaultInputFilename = config.getStudentsFile() parser = argparse.ArgumentParser(description='Disambiguate First Names.') parser.add_argument('lab',metavar='labxx', help="which lab (e.g. lab00, lab01, etc.)") parser.add_argument('-i','--infileName', help='input file (default: ' + defaultInputFilename+"'", default=defaultInputFilename) parser.add_argument('-u','--githubUsername', help="github username, default is current OS user", default=getpass.getuser()) args = parser.parse_args() pw = getpass.getpass() g = Github(args.githubUsername, pw, user_agent="PyGithub") org= g.get_organization(config.getOrgName()) createLabRepo(g,org,args.infileName,args.lab) sys.exit(0)
labSubmissionsDir = config.getLabSubmissionsDir() if not os.access(labSubmissionsDir, os.W_OK): os.mkdir(labSubmissionsDir, 0700) from github import Github from github import GithubException parser = argparse.ArgumentParser(description='Pull repos for grading that start with a certain prefix') parser.add_argument('prefix',help='prefix e.g. lab00') parser.add_argument('-u','--githubUsername', help="github username, default is current OS user", default=getpass.getuser()) parser.add_argument('-o','--orgName', help="organization e.g. UCSD-CSE-100", default=config.getOrgName()) args = parser.parse_args() username = args.githubUsername pw = getpass.getpass() g = Github(username, pw, user_agent='PyGithub') print("All repos for organization: ",args.orgName) org = g.get_organization(args.orgName) ## TODO: Add some error checking code here to see whether ## the lookup was successful. Do we try/except or check the return value? repos = org.get_repos()
os.mkdir(labSubmissionsDir, 0700) from github import Github from github import GithubException parser = argparse.ArgumentParser( description='Pull repos for grading that start with a certain prefix') parser.add_argument('prefix', help='prefix e.g. lab00') parser.add_argument('-u', '--githubUsername', help="github username, default is current OS user", default=getpass.getuser()) parser.add_argument('-o', '--orgName', help="organization e.g. UCSD-CSE-100", default=config.getOrgName()) args = parser.parse_args() username = args.githubUsername pw = getpass.getpass() g = Github(username, pw, user_agent='PyGithub') print("All repos for organization: ", args.orgName) org = g.get_organization(args.orgName) ## TODO: Add some error checking code here to see whether ## the lookup was successful. Do we try/except or check the return value? repos = org.get_repos()