Example #1
0
    def get_next_screens(self):
        links = []
        screen_vertex = Vertex(self.handler)
        if isinstance(self.screen_content.get("next_screen"), list):
            for i in self.screen_content.get("next_screen", []):
                links.append(
                    Link(screen_vertex,
                         Vertex(i['next_screen'], ""),
                         i['condition'])
            )
        elif self.screen_content.get('next_screen'):
            links.append(
                Link(
                    screen_vertex,
                    Vertex(self.screen_content['next_screen']),
                    self.screen_content['session_key']
                )
            )

        if self.screen_content.get('default_next_screen'):
            links.append(
                Link(
                    screen_vertex,
                    Vertex(self.screen_content['default_next_screen'], ""),
                    self.screen_content['session_key']
                )
            )
        return links
 def get_next_screens(self):
     return [
         Link(
             Vertex(self.handler),
             Vertex(self.screen_content['next_screen'],
                    ""
                    )
         )
     ]
Example #3
0
 def get_next_screens(self) -> typing.List[Link]:
     if self.custom_screen_instance.__class__.__dict__.get(
             'get_next_screens'):
         return self.custom_screen_instance.get_next_screens()
     return [
         Link(Vertex(self.handler),
              Vertex(self.screen_content['next_screen']),
              self.screen_content['input_identifier'])
     ]
Example #4
0
    def get_next_screens(self):
        links = []

        for obj in self.screen_content['router_options']:
            links.append(
                Link(Vertex(self.handler), Vertex(obj['next_screen']),
                     obj['expression']))

        if self.screen_content.get('default_next_screen'):
            links.append(
                Link(Vertex(self.handler),
                     Vertex(self.screen_content['default_next_screen']),
                     'default'))

        return links
Example #5
0
    def get_next_screens(self) -> typing.List[Link]:
        # generate validators links
        links = []
        screen_vertex = Vertex(self.handler)
        for index, validation_screen in enumerate(
                self.screen_content.get("validators", [])):
            validator_screen_name = self.handler + "_validator_" + str(index +
                                                                       1)
            validation_vertex = Vertex(
                validator_screen_name,
                self.get_text(validation_screen['text']))
            if 'regex' in validation_screen:
                validation_command = 'regex: ' + validation_screen['regex']
            else:
                validation_command = 'expression: ' + validation_screen[
                    'expression']
            links.append(
                Link(screen_vertex, validation_vertex, "validation", "arrow",
                     "dotted"))

            links.append(
                Link(validation_vertex, screen_vertex, validation_command,
                     "arrow", "dotted"))

        if isinstance(self.screen_content.get("next_screen"), list):
            for i in self.screen_content.get("next_screen", []):
                links.append(
                    Link(screen_vertex, Vertex(i['next_screen'], ""),
                         i['condition']))
        elif self.screen_content.get('next_screen'):
            links.append(
                Link(screen_vertex, Vertex(self.screen_content['next_screen']),
                     self.screen_content['input_identifier']))

        if self.screen_content.get('default_next_screen'):
            links.append(
                Link(screen_vertex,
                     Vertex(self.screen_content['default_next_screen'], ""),
                     self.screen_content['input_identifier']))
        return links + super(InputScreen, self).get_next_screens()
Example #6
0
    def get_next_screens(self) -> typing.List[Link]:
        links = []
        screen_vertex = Vertex(self.handler)
        if self.list_options:
            item_section = self.screen_content['items']
            links.append(
                Link(screen_vertex, Vertex(item_section['next_screen']),
                     item_section['session_key']))

        for option in self.menu_options:
            if isinstance(option.next_screen, list):
                for i in option.next_screen:
                    links.append(
                        Link(
                            screen_vertex, Vertex(i['next_screen']),
                            "option: {option}\nrouting: {routing}\n".format(
                                option=option.raw_text,
                                routing=i['condition'])))
            else:
                links.append(
                    Link(screen_vertex, Vertex(option.next_screen),
                         option.raw_text))

        return links
Example #7
0
 def get_next_screens(self):
     return [
         Link(Vertex(self.handler), Vertex('custom_screen_2'), "")
     ]
Example #8
0
 def get_next_screens(self):
     return [
         Link(Vertex(self.handler),
              Vertex(self.screen_content['next_screen']),
              self.screen_content['session_key'])
     ]
Example #9
0
 def get_next_screens(self) -> typing.List[Link]:
     next_screens = self.screen_content['next_screen']
     return [Link(Vertex(self.handler), Vertex(next_screens, ''), "")]