-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreateLabRepo.py
More file actions
executable file
·61 lines (36 loc) · 1.69 KB
/
createLabRepo.py
File metadata and controls
executable file
·61 lines (36 loc) · 1.69 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
#!/usr/bin/python
# This script reads all the users from the CSV file created
# by the Google Form.
# If first checks for any duplicate first names. If there are duplicate
# first names, it deambiguates the first names by adding first letters of
# the last name until the names are distinguished.
# It then:
# (1) checks if the github user exists (bails, if not)
# (2) creates the Student_FirstName team (if not already there)
# (3) adds the github user to the Student_FirstName team and AllStudents team
from __future__ import print_function
from github_acadwf import createLabRepo
import getpass
import sys
import argparse
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 = '../CS56-S13-data/CS56 S13 Github Userids (Responses) - Form Responses.csv'
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("UCSB-CS56-S13")
createLabRepo(g,org,args.infileName,args.lab)