-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdatePairsForLab.py
More file actions
executable file
·66 lines (41 loc) · 1.84 KB
/
updatePairsForLab.py
File metadata and controls
executable file
·66 lines (41 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/python
# This script looks up every pair team that exists.
# It then,for each pair team
# (4) creates a repo for the team (if it doesn't already exist)
# (5) populates it, but only if it was JUST created.
import getpass
import argparse
import os
import sys
from github_acadwf import addPyGithubToPath
from github_acadwf import updatePairsForLab
#from github_acadwf import createLabRepo
#from github_acadwf import findTeam
#from github_acadwf import pushFilesToRepo
addPyGithubToPath()
from github import Github
from github import GithubException
defaultInputFilename = '../CS56-S13-data/CS56 S13 Github Userids (Responses) - Form Responses.csv'
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',
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="./scratchRepos")
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("UCSB-CS56-S13")
updatePairsForLab(g,org,args.lab,args.scratchDirName, args.teamPrefix)