Beispiel #1
0
def outputAs_iCal():
    cal = create_ics(courseTableObj, semester_start_date)
    if output_exam.get() == 1:
        cal = create_exam_ics(cal, examScheduleObj)
    export_ics(cal, semester_year, semester, stu_ID)
    print('OutputAs_iCal here.')
    insert_log_end('OutputAs_iCal here.\n')
Beispiel #2
0
                choice = int(
                    input(
                        'Please input your choice (`0`: personal, `1`: class):'
                    ))
                if choice in [0, 1]:
                    break
                else:
                    print('ERROR! Choice shoule be `0` or `1`!')

        temp_time = time.time()  # 计个时看看
        name = aao_login(stuID, stuPwd, retry_cnt)
        print('\nMeow~下面开始获取{}课表啦!\n'.format({0: '个人', 1: '班级'}.get(choice)))
        courseTable = getCourseTable(choice=choice)
        list_lessonObj = parseCourseTable(courseTable)
        print('课表获取完成,下面开始生成iCal日历文件啦!')
        cal = create_ics(list_lessonObj, semester_start_date)
        print('日历生成完成,下面开始导出啦!\n')
        export_ics(cal, semester_year, semester, stuID)  # Export `.ics` file
        if not args.notxt:  # 若命令行参数含`--notxt`则不导出
            exportCourseTable(list_lessonObj, semester_year, semester,
                              stuID)  # Export `.txt` file
        if not args.noxlsx:  # 若命令行参数含`--noxlsx`则不导出
            print('\n开始生成xlsx表格文件! ')
            xlsx = create_xls(list_lessonObj, semester_year, semester, stuID)
            print('xlsx文件生成完成,开始导出!')
            export_xls(xlsx, semester_year, semester,
                       stuID)  # Export `.xlsx` file
        print('\n导出完成,累计用时:', time.time() - temp_time, 's')
        print("Thanks for your use! 欢迎来GitHub上点个Star呢!")
    except Exception as e:
        print("ERROR! 欢迎在GitHub上提出issue & Pull Request!")