Fixup: YAML tags

This commit is contained in:
Tim Schubert 2018-03-28 18:28:14 +02:00
parent 34b1bd617e
commit fd6fc66e29
2 changed files with 17 additions and 22 deletions

View file

@ -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):

View file

@ -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
tag: Exercise 1 base: solutions
time: 2018-04-01t00:00.00 deadlines:
ref: master - !!python/object:abgabesystem.Deadline
tag: Exercise 1
- time: !!timestamp 2018-04-01
!!Deadline ref: master
tag: Exercise 2 - !!python/object:abgabesystem.Deadline
time: 2018-04-15t15:00.00 tag: Exercise 2
ref: master time: !!timestamp 2018-04-15
ref: master