Ejemplo n.º 1
0
			courses = Api.get_courses(cookies)
			root = Tk()
			root.withdraw()
			folder_path = askdirectory()
			print folder_path
			user.user_folder = folder_path
			db.add(user)
			db.add_all(courses)
			db.commit()
		else:
			courses = db.query(Course)
			folder_path = user.user_folder
			print folder_path
		for course in courses:
				if course.course_secret != "xyz":
					Api.download(course, cookies, folder_path)
		print "All done Successfully"

	else:
		print "Invalid Credentials Quitting the program"
except Exception,e: print str(e)

raw_input("press any key to quit")

	


			
		
 
Ejemplo n.º 2
0
	if login:
		loggedin = True
		if first:
			courses = api.get_courses()
			root = Tk()
			root.withdraw()
			folder_path = askdirectory()
			print folder_path
			user.user_folder = folder_path
			db.add(user)
			db.add_all(courses)
			db.commit()
		else:
			courses = db.query(Course)
			folder_path = user.user_folder
		api.download(courses, folder_path)
		print "All done Successfully"

	else:
		print "Invalid Credentials Quitting the program"
except Exception,e: print str(e)

raw_input("press any key to quit")