def parse_args():
    """ Parses the system arguments and returns the arguments  """
    parser = argparse.ArgumentParser(description='Pull students for grading')
    parser.add_argument('labno', help='labno e.g. PA1')
    parser.add_argument('date', help='Due date in YYYY-MM-DD format')
    parser.add_argument('time', help='Due Time in 24-Hour HH:MM format')
    parser.add_argument('-d',
                        '--checkpt_date',
                        help='Checkpoint date YYYY-MM-DD format',
                        default=None)
    parser.add_argument('-t',
                        '--checkpt_time',
                        help='Checkpoint date HH:MM format',
                        default=None)
    parser.add_argument('-i',
                        '--infile_name',
                        help='Input file for pulling (default: None)',
                        default=None)
    parser.add_argument('-p',
                        '--pair_fn',
                        help='input file (default: ' + config.getPairsFile() +
                        ')',
                        default=config.getPairsFile())
    parser.add_argument('-s', '--students_fn',
                        help='input file (default: '+config.getStudentsFile()\
                             +')', default=config.getStudentsFile())
    parser.add_argument('--debug',
                        dest='dbg',
                        action='store_true',
                        help='Enable debug output to a log file',
                        default=False)
    return parser.parse_args()
def parse_args():
    """ Parses the system arguments and returns the arguments  """
    parser = argparse.ArgumentParser(description='Pull students for grading')
    parser.add_argument('labno', help='labno e.g. PA1')
    parser.add_argument('date', help='Due date in YYYY-MM-DD format')
    parser.add_argument('time', help='Due Time in 24-Hour HH:MM format')
    parser.add_argument('-d', '--checkpt_date',
                        help='Checkpoint date YYYY-MM-DD format',
                        default=None)
    parser.add_argument('-t', '--checkpt_time',
                        help='Checkpoint date HH:MM format',
                        default=None)
    parser.add_argument('-i', '--infile_name',
                        help='Input file for pulling (default: None)',
                        default=None)
    parser.add_argument('-p', '--pair_fn',
                        help='input file (default: '+config.getPairsFile()+')',
                        default=config.getPairsFile())
    parser.add_argument('-s', '--students_fn',
                        help='input file (default: '+config.getStudentsFile()\
                             +')', default=config.getStudentsFile())
    parser.add_argument('--debug', dest='dbg', action='store_true',
                        help='Enable debug output to a log file',
                        default=False)
    return parser.parse_args()
def archive_solo(org, labs, credentials, delrepo):
    """ Archives all students's solo repository  """
    students  = getclass.get_students(config.getStudentsFile())
    for lab in labs:
        for student in students.keys():
            if not checkrepo.check_repo_ghid(org, lab, student):
                continue
            repo_name = SOLO_REPO.format(lab, student)
            archive_repo(labno=lab, name=repo_name, ghid=student, ghid2=None)
            if delrepo:
                deleterepo.delete_repo(org, repo_name, credentials)
def archive_solo(org, labs, credentials, delrepo):
    """ Archives all students's solo repository  """
    students = getclass.get_students(config.getStudentsFile())
    for lab in labs:
        for student in students.keys():
            if not checkrepo.check_repo_ghid(org, lab, student):
                continue
            repo_name = SOLO_REPO.format(lab, student)
            archive_repo(labno=lab, name=repo_name, ghid=student, ghid2=None)
            if delrepo:
                deleterepo.delete_repo(org, repo_name, credentials)
Пример #5
0
#from github_acadwf import createLabRepo
#from github_acadwf import findTeam
#from github_acadwf import pushFilesToRepo

addPyGithubToPath()

from github import Github
from github import GithubException

try:
    import config
except ImportError:
    print("Could not import configuration")
    sys.exit(1)

defaultInputFilename = config.getStudentsFile()

parser = argparse.ArgumentParser(
    description='Update for lab only for new users')

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',
Пример #6
0
	print("Unable to find config file, please see sample_config.py")
	sys.exit(1)

import config


from disambiguateFunctions import makeUserDict
from disambiguateFunctions import disambiguateAllFirstNames
from disambiguateFunctions import getUserList

sys.path.append("./PyGithub");

from github import Github
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")
Пример #7
0
#Initialize the variables
args = parse_arguments()
lab = args.prefix
tutors = config.getTutors()
numTutors = len(tutors)
due_date = args.date
due_time = args.time
chk_date = args.checkpt_date
chk_time = args.checkpt_time
count = 0
dbg_log = None

submissions_dir = config.getLabSubmissionsDir()
pairs = get_pairs(args.pairfileName)
students = get_students(config.getStudentsFile())

#clean out submissions dir
for file_name in os.listdir(submissions_dir):
    os.remove(submissions_dir + file_name)

#create clean csvs
tutor_csvs = {}
for tutor in tutors:
    try:
        tutor_csvs[tutor] = open(submissions_dir + tutor + ".csv", 'wb')
        tutor_csvs[tutor].write("Tutor,Student,Github ID,Pair\n")
    except IOError:
        print("Could not open csv file for " + tutor)
        sys.exit(1)
import os
import sys
import random


sys.path.append("../PyGithub")
sys.path.append("..")

import config
pairs = {}
students = {}

#add all pairs to a dict, put in twice to map both ways
with open(config.getPairsFile(), 'rb') as pairFile:
    pair_reader = csv.DictReader(pairFile)
    for line in pair_reader:
        pairs[line['Partner1_GithubID'].lower()] = line['Partner2_GithubID'].lower()
        pairs[line['Partner2_GithubID'].lower()] = line['Partner1_GithubID'].lower()

#add all students to a dict
with open(config.getStudentsFile(), 'rb') as studentsFile:
    student_reader = csv.DictReader(studentsFile)
    for line in student_reader:
        students[line['github userid'].lower()] = line['First Name'] + " " + line['Last Name']

# check_pairs(students, pairs)
# check_repos(students, pairs)
check_pairs(students, pairs)

sys.exit(0)
Пример #9
0
import random

sys.path.append("../PyGithub")
sys.path.append("..")

import config
pairs = {}
students = {}

#add all pairs to a dict, put in twice to map both ways
with open(config.getPairsFile(), 'rb') as pairFile:
    pair_reader = csv.DictReader(pairFile)
    for line in pair_reader:
        pairs[line['Partner1_GithubID'].lower(
        )] = line['Partner2_GithubID'].lower()
        pairs[line['Partner2_GithubID'].lower(
        )] = line['Partner1_GithubID'].lower()

#add all students to a dict
with open(config.getStudentsFile(), 'rb') as studentsFile:
    student_reader = csv.DictReader(studentsFile)
    for line in student_reader:
        students[line['github userid'].lower(
        )] = line['First Name'] + " " + line['Last Name']

# check_pairs(students, pairs)
# check_repos(students, pairs)
check_pairs(students, pairs)

sys.exit(0)