diff --git a/rigestryWin.py b/rigestryWin.py index 7815c2c..e890091 100644 --- a/rigestryWin.py +++ b/rigestryWin.py @@ -1,10 +1,34 @@ from api.eventRigestry import EventRegistry from config import CONFIG +from tkinter import * +from tkhtmlview import HTMLLabel -rigestry=EventRegistry(CONFIG['moodle']['username'], CONFIG['moodle']['password']) +def createRigestryWin(): + + root=Tk() + winScrollBar=Scrollbar(root) + htmlLb=HTMLLabel(root,html="") + winScrollBar.pack(side=RIGHT,fill="y") + htmlLb.pack(fill=BOTH) -if rigestry.status: - for a in rigestry.getEventsList(): - print(a) -else: - print("NO") + + htmlLb.configure(yscrollcommand=winScrollBar.set) + + ht='''
讀取中
''' + htmlLb.set_html(ht) + root.update() + html='''''' + + rigestry=EventRegistry(CONFIG['moodle']['username'], CONFIG['moodle']['password']) + + if rigestry.status: + for i in rigestry.getEventsList(): + html+=''' 活動ID:{} 學期{}
活動報名狀態:{}
活動名稱:{}
活動開始時間: {}
報名方式:{}
時數: {}
講師: {}
申請為教師之能活動: {}

'''.format( + i.get("id"),i.get("semester"),i.get("status"),i.get("name"),i.get("time"),i.get("method"),i.get("hour"),i.get("speaker"),i.get("teacherEvevt") ) + + htmlLb.set_html(html) + + else: + print("NO") + + root.mainloop()