diff --git a/app.py b/app.py new file mode 100644 index 0000000..d777cf6 --- /dev/null +++ b/app.py @@ -0,0 +1,31 @@ +from appJar import gui +from itl_scrape import itslearning_scraper +app = gui("It's learning scraper") +scraper = itslearning_scraper() + +def press(btn): + user = app.getEntry("feideuser") + password = app.getEntry("password") + scraper.login(user,password) + +#if course_url: +#else: + print("pressed button", app.getEntry("feideuser"), app.getEntry("password")) + app.removeAllWidgets() + app.addLabel("title", "Courses to be selected", 0, 0, 2) + test = scraper.get_courses() + for i, label in enumerate(test): + app.addCheckBox(test[label], i+1 ,0) + +app.startLabelFrame("It's Learning time") +app.setSticky("ew") +app.setFont(20) + +app.addLabel("feideuser", "Username:", 0,0) +app.addEntry("feideuser",0,1) +app.addLabel("password", "Password:", 1, 0) +app.addSecretEntry("password", 1 , 1) +app.stopLabelFrame() +app.addButton("Login", press, 2, 0, 2) +app.setFocus("feideuser") +app.go() diff --git a/requirements.txt b/requirements.txt index 3029fd1..4739b7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ beautifulsoup4==4.6.0 MechanicalSoup==0.7.0 html2text==2016.9.19 requests==2.13.0 +appJar==0.52