def next_sub_section(self): """ next section and skip this section treating both these operations as same """ """ As of now we have only one lesson """ read_out = ReadOut() segment = "lessons" lesson = "What's the Weather Like" sub_section = self.context["parameters"]["lesson_sub_section"] try: section = self.context["parameters"]["lesson_section"] except: section = fetch_section_with_sub_section_name(sub_section) """ TO-DO :: get section name by getting sub_section """ NextSubSection, PreviousSubSection = self.get_sub_section( section, sub_section) if not NextSubSection: raise ( OperationsException("There are no sub-sections after this.")) self.params["lesson_sub_section"] = NextSubSection response = "The next sub-section is " + "<break time='0.5s' />" response += read_out.read_sub_section(lesson, section, NextSubSection) return response
def previous_sub_section(self): read_out = ReadOut() segment = "lessons" lesson = "What's the Weather Like" sub_section = self.context["parameters"]["lesson_sub_section"] try: section = self.context["parameters"]["lesson_section"] except: section = fetch_section_with_sub_section_name(sub_section) """ TO-DO :: get section name by getting sub_section """ NextSubSection, PreviousSubSection = self.get_sub_section( section, sub_section) if not PreviousSubSection: raise ( OperationsException("There are no sub-sections before this.")) self.params["lesson_sub_section"] = PreviousSubSection response = "The previous sub-section is " + "<break time='0.5s' />" response += read_out.read_sub_section(lesson, section, PreviousSubSection) return response
def read_lesson_sub_section(self): read_out = ReadOut() context_manager = ContextManager(self.context) """ As of now we have only one lesson """ segment = "lessons" lesson = "What's the Weather Like" sub_section = self.params["lesson_sub_section"] #try : # section = context_manager.fetch_data_from_context("lesson_section") #except: section = fetch_section_with_sub_section_name(sub_section) # response = fetch_ordinal_of_section("lessons",sub_section, "sub_sections") response = read_out.read_sub_section(lesson, section, sub_section, self.params["query"]) self.context = self.context_manager.set_context_for_read_out( self.params, response) return response, self.context