コード例 #1
0
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()
コード例 #2
0
def parse_arguments():
    parser = argparse.ArgumentParser(description='Pull Students for grading')
    parser.add_argument('prefix', help='prefix 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 YYYY-MM-DD format',
                        default=None)
    parser.add_argument('-i',
                        '--infileName',
                        help='input file (default: None)',
                        default=None)
    parser.add_argument('-p',
                        '--pairfileName',
                        help='input file (default: ' + config.getPairsFile() +
                        ')',
                        default=config.getPairsFile())
    parser.add_argument('--debug',
                        dest='dbg',
                        action='store_true',
                        help='Enables debug output to a log file',
                        default=False)
    return parser.parse_args()
コード例 #3
0
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()
コード例 #4
0
def archive_pairs(org, labs, credentials, delrepo):
    """ Logic for archiving student pairs  """
     #Currently hardcoded, need a way to put this in the config file for P1
    p1pairsfn = "/Users/arden/Documents/Github/scripts_ucsd_acadwf_fork/\
                 P1Pairs.csv"
    p1pairs   = getclass.get_pairs(p1pairsfn)
    p2pairs   = getclass.get_pairs(config.getPairsFile())

    for lab in labs[0:2]:
        archive_pairs_for_lab(org, lab, credentials, p1pairs, delrepo)

    for lab in labs[2:]:
        archive_pairs_for_lab(org, lab, credentials, p2pairs, delrepo)
コード例 #5
0
def archive_pairs(org, labs, credentials, delrepo):
    """ Logic for archiving student pairs  """
    #Currently hardcoded, need a way to put this in the config file for P1
    p1pairsfn = "/Users/arden/Documents/Github/scripts_ucsd_acadwf_fork/\
                 P1Pairs.csv"

    p1pairs = getclass.get_pairs(p1pairsfn)
    p2pairs = getclass.get_pairs(config.getPairsFile())

    for lab in labs[0:2]:
        archive_pairs_for_lab(org, lab, credentials, p1pairs, delrepo)

    for lab in labs[2:]:
        archive_pairs_for_lab(org, lab, credentials, p2pairs, delrepo)
コード例 #6
0
from github_acadwf import addPyGithubToPath
from github_acadwf import addTeamsForPairsInFile

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

addPyGithubToPath()

from github import Github
from github import GithubException

defaultInputFileName =  config.getStudentsFile()
defaultPairFileName  =  config.getPairsFile()

parser = argparse.ArgumentParser(description='Setup teams for pairs')

parser.add_argument('-i','--inFileName',
                    help='input file (default: ' + defaultInputFileName+"'",
                    default=defaultInputFileName)

parser.add_argument('-p','--pairFileName',
                    help='pair file (default: ' + defaultPairFileName+"'",
                    default=defaultPairFileName)

parser.add_argument('-u','--githubUsername',
                    help="github username, default is current OS user",
                    default=getpass.getuser())
コード例 #7
0
from github_acadwf import addPyGithubToPath
from github_acadwf import addTeamsForPairsInFile

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

addPyGithubToPath()

from github import Github
from github import GithubException

defaultInputFileName = config.getStudentsFile()
defaultPairFileName = config.getPairsFile()

parser = argparse.ArgumentParser(description='Setup teams for pairs')

parser.add_argument('-i',
                    '--inFileName',
                    help='input file (default: ' + defaultInputFileName + "'",
                    default=defaultInputFileName)

parser.add_argument('-p',
                    '--pairFileName',
                    help='pair file (default: ' + defaultPairFileName + "'",
                    default=defaultPairFileName)

parser.add_argument('-u',
                    '--githubUsername',
コード例 #8
0
import csv
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)
コード例 #9
0

import csv
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)