Fixup: YAML tags
This commit is contained in:
parent
34b1bd617e
commit
fd6fc66e29
2 changed files with 17 additions and 22 deletions
|
@ -39,10 +39,9 @@ class Course(yaml.YAMLObject):
|
||||||
|
|
||||||
yaml_tag = 'Course'
|
yaml_tag = 'Course'
|
||||||
|
|
||||||
def __init__(self, name, base, ldap, deadlines):
|
def __init__(self, name, base, deadlines):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.base = base
|
self.base = base
|
||||||
self.ldap = ldap
|
|
||||||
self.deadlines = deadlines
|
self.deadlines = deadlines
|
||||||
|
|
||||||
def create_group(self, gl):
|
def create_group(self, gl):
|
||||||
|
@ -123,20 +122,20 @@ def deadlines(gl, course, args):
|
||||||
deadline.trigger(course)
|
deadline.trigger(course)
|
||||||
|
|
||||||
|
|
||||||
def sync(gl, courses, args):
|
def sync(gl, conf, args):
|
||||||
"""Sync groups and students from Stud.IP to Gitlab and create student
|
"""Sync groups and students from Stud.IP to Gitlab and create student
|
||||||
projects
|
projects
|
||||||
|
|
||||||
one-way sync!!!
|
one-way sync!!!
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for course in courses:
|
for course in conf['courses']:
|
||||||
course.create_group(gl)
|
course.create_group(gl)
|
||||||
create_project(course.group)
|
create_project(course.group)
|
||||||
|
|
||||||
with open(args.students[0]) as csvfile:
|
with open(args.students[0]) as csvfile:
|
||||||
for student in Student.from_csv(csvfile):
|
for student in Student.from_csv(csvfile):
|
||||||
student.create_user(gl, course.ldap)
|
student.create_user(gl, conf['ldap'])
|
||||||
|
|
||||||
|
|
||||||
def parseconf(conf):
|
def parseconf(conf):
|
||||||
|
|
22
config.yml
22
config.yml
|
@ -1,20 +1,16 @@
|
||||||
---
|
|
||||||
!!Course
|
|
||||||
name: Programmieren 1
|
|
||||||
base: solutions
|
|
||||||
ldap:
|
ldap:
|
||||||
basedn: "ou=people,dc=tu-bs,dc=de"
|
basedn: "ou=people,dc=tu-bs,dc=de"
|
||||||
provider: main
|
provider: main
|
||||||
deadlines:
|
courses:
|
||||||
-
|
- !!python/object:abgabesystem.Course
|
||||||
!!Deadline
|
name: Programmieren 1
|
||||||
|
base: solutions
|
||||||
|
deadlines:
|
||||||
|
- !!python/object:abgabesystem.Deadline
|
||||||
tag: Exercise 1
|
tag: Exercise 1
|
||||||
time: 2018-04-01t00:00.00
|
time: !!timestamp 2018-04-01
|
||||||
ref: master
|
ref: master
|
||||||
|
- !!python/object:abgabesystem.Deadline
|
||||||
-
|
|
||||||
!!Deadline
|
|
||||||
tag: Exercise 2
|
tag: Exercise 2
|
||||||
time: 2018-04-15t15:00.00
|
time: !!timestamp 2018-04-15
|
||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue