Exemplo n.º 1
0
def check_course():
    print('\033[32m查看课程\033[0m')
    courses = common.get_object_list('course')
    print('=' * 30)
    for name in courses:
        print(admin_api.get_course_info(name))
        print('-' * 30)
Exemplo n.º 2
0
def check_school():
    print('\033[32m查看学校\033[0m')
    schools = common.get_object_list('school')
    print('=' * 30)
    for name in schools:
        print(admin_api.get_school_info(name))
        print('-' * 30)
Exemplo n.º 3
0
def check_teacher():
    print('\033[32m查看老师\033[0m')
    teachers = common.get_object_list('teacher')
    print('=' * 30)
    for name in teachers:
        print(admin_api.get_teacher_info(name))
        print('-' * 30)
Exemplo n.º 4
0
def check_course():
    print('\033[32m查看课程\033[0m')
    course_list = common.get_object_list('course')
    if not course_list:
        print('\033[31m课程列表为空!\033[0m')
        return
    print('-' * 30)
    for k, v in enumerate(course_list):
        print('%s %s' % (k, v))
Exemplo n.º 5
0
def check_teacher():
    print('\033[32m查看老师\033[0m')
    teacher_list = common.get_object_list('teacher')
    if not teacher_list:
        print('\033[31m老师列表为空!\033[0m')
        return
    print('-' * 30)
    for k, v in enumerate(teacher_list):
        print('%s %s' % (k, v))
Exemplo n.º 6
0
def check_course():
    print('\033[32m查看课程\033[0m')
    course = common.get_object_list('course')
    print('-' * 30)
    if not course:
        print('\033[31m学校列表为空!\033[0m')
        return
    for k, name in enumerate(course):
        print('%s %s' % (k, admin_api.get_course_info(CURRENT_USER, name)))
    print('-' * 30)
Exemplo n.º 7
0
def check_teacher():
    print('\033[32m查看老师\033[0m')
    teachers = common.get_object_list('teacher')
    print('-' * 30)
    if not teachers:
        print('\033[31m学校列表为空!\033[0m')
        return
    for k, name in enumerate(teachers):
        print('%s %s' % (k, admin_api.get_teacher_info(CURRENT_USER, name)))
    print('-' * 30)
Exemplo n.º 8
0
def check_school():
    print('\033[32m查看学校\033[0m')
    schools = common.get_object_list('school')
    print('-' * 30)
    if not schools:
        print('\033[31m学校列表为空!\033[0m')
        return
    for k, name in enumerate(schools):
        print('%s %s' % (k, admin_api.get_school_info(CURRENT_USER, name)))
    print('-' * 30)
Exemplo n.º 9
0
def check_school(show=True):
    if show:
        print('\033[32m查看学校\033[0m')
    school_list = common.get_object_list('school')
    if not school_list:
        print('\033[31m学校列表为空!\033[0m')
        return
    print('-' * 30)
    for k, v in enumerate(school_list):
        print('%s %s' % (k, v))
    return school_list
Exemplo n.º 10
0
def choose_school():
    while True:
        schools = common.get_object_list('school')
        for k, v in enumerate(schools):
            print('%-4s %-10s' % (k, v))
        choice = input('请选择课程的学校编号 >>: ').strip()
        if choice == 'q':
            return choice
        if not choice.isdigit():
            print('\033[31m学校编号必须是数字!\033[0m')
            continue
        choice = int(choice)
        if choice < 0 or choice > len(schools):
            print('\033[31m学校编号非法!\033[0m')
            continue
        return schools[choice]
Exemplo n.º 11
0
def choose_school():
    while True:
        schools = common.get_object_list('school')
        print('-' * 30)
        for k, v in enumerate(schools):
            print('%-4s%-10s' % (k, v))
        print('-' * 30)
        choice = input('请选择学校编号 >>: ').strip()
        if choice == 'q': break
        if not choice.isdigit():
            print('\033[31m选择编号必须是数字!\033[0m')
            continue
        choice = int(choice)
        if choice < 0 or choice > len(schools):
            print('\033[31m选择编号超出范围!\033[0m')
        school_name = schools[choice]
        return school_name
Exemplo n.º 12
0
def choose_course():
    print('\033[32m选择教授课程\033[0m')
    while True:
        course = common.get_object_list('course')
        print('-' * 30)
        for k, v in enumerate(course):
            print('%s %s' % (k, v))
        print('-' * 30)
        choice = input('请选择教授课程编号 >>: ').strip()
        if choice == 'q':
            return choice
        if not choice.isdigit():
            print('\033[31m课程编号必须是数字!\033[0m')
            continue
        choice = int(choice)
        if choice < 0 or choice > len(course):
            print('\033[31m课程编号非法!\033[0m')
            continue
        flag, msg = teacher_api.choose_course(CURRENT_USER, course[choice])
        if flag:
            print('\033[32m%s\033[0m' % msg)
            return
        else:
            print('\033[31m%s\033[0m' % msg)