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'
|
||||
|
||||
def __init__(self, name, base, ldap, deadlines):
|
||||
def __init__(self, name, base, deadlines):
|
||||
self.name = name
|
||||
self.base = base
|
||||
self.ldap = ldap
|
||||
self.deadlines = deadlines
|
||||
|
||||
def create_group(self, gl):
|
||||
|
@ -123,20 +122,20 @@ def deadlines(gl, course, args):
|
|||
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
|
||||
projects
|
||||
|
||||
one-way sync!!!
|
||||
"""
|
||||
|
||||
for course in courses:
|
||||
for course in conf['courses']:
|
||||
course.create_group(gl)
|
||||
create_project(course.group)
|
||||
|
||||
with open(args.students[0]) as csvfile:
|
||||
for student in Student.from_csv(csvfile):
|
||||
student.create_user(gl, course.ldap)
|
||||
student.create_user(gl, conf['ldap'])
|
||||
|
||||
|
||||
def parseconf(conf):
|
||||
|
|
30
config.yml
30
config.yml
|
@ -1,20 +1,16 @@
|
|||
---
|
||||
!!Course
|
||||
name: Programmieren 1
|
||||
base: solutions
|
||||
ldap:
|
||||
basedn: "ou=people,dc=tu-bs,dc=de"
|
||||
provider: main
|
||||
deadlines:
|
||||
-
|
||||
!!Deadline
|
||||
tag: Exercise 1
|
||||
time: 2018-04-01t00:00.00
|
||||
ref: master
|
||||
|
||||
-
|
||||
!!Deadline
|
||||
tag: Exercise 2
|
||||
time: 2018-04-15t15:00.00
|
||||
ref: master
|
||||
|
||||
courses:
|
||||
- !!python/object:abgabesystem.Course
|
||||
name: Programmieren 1
|
||||
base: solutions
|
||||
deadlines:
|
||||
- !!python/object:abgabesystem.Deadline
|
||||
tag: Exercise 1
|
||||
time: !!timestamp 2018-04-01
|
||||
ref: master
|
||||
- !!python/object:abgabesystem.Deadline
|
||||
tag: Exercise 2
|
||||
time: !!timestamp 2018-04-15
|
||||
ref: master
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue