Example #1
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--xml",
                        type=str,
                        help="Location of timetable xml file",
                        required=False)
    parser.add_argument("--begin",
                        type=str,
                        help="Semester beginning date",
                        required=True)
    parser.add_argument("--end",
                        type=str,
                        help="Semester ending date",
                        required=True)
    args = parser.parse_args()

    xml = ""
    if (args.xml):
        xml = args.xml

    else:
        username = input('에브리타임 아이디 : ')
        password = getpass.getpass()

        year = input('가져올 년도 : ')
        semester = input('가져올 학기 : ')

        e = everytime.Everytime(username, password)
        xml = e.get_timetable(year, semester)

    c = Convert(xml)
    c.get_calendar(c.get_subjects(), args.begin, args.end)
Example #2
0
def DownCal(begin, end, username, password):

    # year = input('가져올 년도 : ')
    # semester = input('가져올 학기 : ')

    e = everytime.Everytime(username, password)
    xml = e.get_timetable(year, semester)

    c = Convert(xml)
    c.get_calendar(c.get_subjects(), begin, end)

    print('test SUCESS')
Example #3
0
 def test_get_calendar(self):
     c = Convert(self.test_xml)
     c.get_calendar(c.get_subjects(), "20180301", "20181231")
Example #4
0
 def test_get_subjects(self):
     c = Convert(self.test_xml)
     self.assertGreater(len(c.get_subjects()), 0)