Exemplo n.º 1
0
# all enrolled courses
import sys
from courses import Courses
from faculties import Faculties
from news import News
from students import Students
if len(sys.argv) == 1:
    exit(1)

if sys.argv[1] == '-c' or sys.argv[1] == '--courses':
    c = Courses()
    if len(sys.argv) == 2:
        c.show_courses()
    elif len(sys.argv) == 3 and (sys.argv[2] == '-a'
                                 or sys.argv[2] == '-autumn'):
        c.show_courses(in_autumn=True, in_spring=False)
    elif len(sys.argv) == 3 and (sys.argv[2] == '-s'
                                 or sys.argv[2] == '-spring'):
        c.show_courses(in_autumn=False, in_spring=True)
    elif len(sys.argv) == 3:
        c.show_filtered_courses(sys.argv[2])
    elif len(sys.argv) > 3:
        with_details = False
        with_description = False
        with_prereqs = False
        with_textrefs = False
        in_autumn = False
        in_spring = False
        for x in sys.argv[3]:
            if x == 'd':
                with_details = True
Exemplo n.º 2
0
# all enrolled courses
import sys
from courses import Courses
from grades import Grades
from quizzes import Quizzes
from assignments import Assignments
from forums import discussion_forums
from discussions import Discussions
from announcements import Announcements

if len(sys.argv) == 1:
    exit(1)

if sys.argv[1] == '-c' or sys.argv[1] == '--courses':
    c = Courses()
    c.show_courses()
elif sys.argv[1] == '-g' or sys.argv[1] == '--grade':
    c = Grades()
    x = sys.argv[2]
    c.show_grades(x)
elif sys.argv[1] == '-q' or sys.argv[1] == '--quiz':
    c = Quizzes()
    x = sys.argv[2]
    c.show_quizzes(x)
elif sys.argv[1] == '-a' or sys.argv[1] == '--assignment':
    c = Assignments()
    if len(sys.argv) == 2:
        c.show_all_assignments()
    elif len(sys.argv) == 3 and sys.argv[2] == '-due':
        c.show_all_due_assignments()
elif sys.argv[1] == '-f' or sys.argv[1] == '--forum':