def _get_course_list(user_profile, username, password): print 'Processing friend %s' % str(user_profile) if user_profile.is_main_schedule_imported: return user_profile.course_list print 'Fetching page..' friend_schedule_page = _fetch_friend_schedule_page(url=user_profile.url_as_friend, username=username, password=password) print 'Parsing course list...' course_list = _fetch_course_data_from_page(friend_schedule_page) print 'Saving result..' ScheduleManager.set_main_schedule(user_profile=user_profile, course_list=course_list) return course_list
def _get_course_list(user_profile, username, password): print 'Processing friend %s' % str(user_profile) if user_profile.is_main_schedule_imported: return user_profile.course_list print 'Fetching page..' friend_schedule_page = _fetch_friend_schedule_page( url=user_profile.url_as_friend, username=username, password=password) print 'Parsing course list...' course_list = _fetch_course_data_from_page(friend_schedule_page) print 'Saving result..' ScheduleManager.set_main_schedule(user_profile=user_profile, course_list=course_list) return course_list
def fetch_course_data(user_profile): username = user_profile.username password = user_profile.password user = user_profile.user if user_profile.is_main_schedule_imported: return user_profile.course_list print "fetching" user_schedule_page = _fetch_user_schedule_page(username, password) course_list = _fetch_course_data_from_page(user_schedule_page) print "Fetched course list" print course_list ScheduleManager.set_main_schedule(user_profile=user_profile, course_list=course_list) return course_list