Example #1
0
 def __init__(
     self,
     bot_controller: AbstractBotController = BotController.get_instance(),
     room_state: AbstractRoomState = RoomState.get_instance(),
     data_service: AbstractDataService = DataService(),
     env: AbstractEnvironment = Environment()):
     self.__bot_controller = bot_controller
     self.__room_state = room_state
     self.__data_service = data_service
     self.__env = env
Example #2
0
def main(passed, search_string, statistic, credentials):

    auth = AuthService(credentials)

    user_name = auth.get_user_name()
    password = auth.get_password()
    graduation = auth.get_graduation()
    subject = auth.get_subject()
    page_service = PageService(user_name, password, graduation, subject)
    grades_overview_page = page_service.get_grades_overview_page()

    data_service = DataService()
    subject_list = data_service.get_subject_list(grades_overview_page, passed,
                                                 search_string)
    average_grade = data_service.calculate_average_grade()
    gained_points = data_service.calculate_gained_points()

    presentation_service = PresentationService()
    presentation_service.print_average_grade(average_grade)
    presentation_service.print_gained_points(gained_points)
    presentation_service.print_subject_table(subject_list)

    if statistic and len(subject_list) == 1 and len(search_string) > 0:
        subject = subject_list[0]
        link = subject[-1]
        exam_statistics_page = page_service.get_statistics_page(link)
        exam_data = data_service.get_exam_statistics_data(exam_statistics_page)
        presentation_service.print_exam_statistics(exam_data)
Example #3
0
File: ro.py Project: jqbx-bot/bot
 def __init__(self, room_state: AbstractRoomState = RoomState.get_instance(),
              data_service: AbstractDataService = DataService()):
     self.__voting_machine = VotingMachine('row')
     self.__room_state = room_state
     self.__data_service = data_service