def create():
     return Input(
         grammar=Grammar(
             items=[
                 "more",
                 "$ more",
                 "$ next",
                 "$ forward"
             ]
         ),
         children=[
             Action(var_name="Show_Next", operator="SET_TO_YES"),
             PageAction.set_to_next(),
             Output(
                 Prompt(items=["Okay."]),
                 children=[
                     Output(
                         Prompt(
                             "\"{Search_Now:\"{Search_Now}\", Color:\"{Color_Preference}\", Style:\"{Style_Preference}\", Index:\"{Current_Index}\", Page:\"{Page}\", Total_Movies:\"{%s}\", Total_Pages:\"{Total_Pages}\"}\"" % NAME_RESULTS_COUNT
                         ),
                         children=[
                             Action(var_name="First_Results", operator="SET_TO_NO"),
                             GetUserInput(
                                 _id="getUserInput_2503174",
                                 children=[
                                     Input(
                                         grammar=Grammar(items=["UPDATE CURRENT_INDEX"]),
                                         children=[
                                             Action(var_name="Show_Next", operator="SET_TO_NO"),
                                             Action(var_name="Show_Previous", operator="SET_TO_NO"),
                                             If(
                                                 elements=[
                                                     Condition(name="Last_Results", operator="EQUAL_TO_YES"),
                                                     Output(
                                                         prompt=Prompt(items="Those were the last results"),
                                                         children=[Goto(ref="profileCheck_2503183")]
                                                     )
                                                 ]
                                             ),
                                             If(
                                                 elements=[
                                                     Condition(name="Current_Index", operator="EQUALS",
                                                               root_text="{%s}" % NAME_RESULTS_COUNT),
                                                     Output(
                                                         prompt=Prompt(
                                                             items=["Here are the last results"]
                                                         ),
                                                         children=[
                                                             Action(var_name="Last_Results", operator="SET_TO_YES"),
                                                             Goto(ref="profileCheck_2503183")
                                                         ]
                                                     )
                                                 ]
                                             ),
                                             Output(
                                                 prompt=Prompt(items=["Here is the next set of results"]),
                                                 children=[
                                                     If(
                                                         elements=[
                                                             StyleConditions.is_blank(),
                                                             ColorConditions.has_value(),
                                                             Output(
                                                                 prompt=Prompt(
                                                                     items=[
                                                                         "for {Style_Preference} {Color_Preference}-rated movies."]),
                                                                 children=[AfterSearchResults.goto()]
                                                             )
                                                         ],
                                                         _id="profileCheck_2503183"
                                                     ),
                                                     If(
                                                         elements=[
                                                             ColorConditions.is_blank(),
                                                             StyleConditions.has_value(),
                                                             Output(
                                                                 Prompt(
                                                                     items=[
                                                                         "for {Recency_Preference} {Genre_Preference} movies."]),
                                                                 children=[AfterSearchResults.goto()]
                                                             )
                                                         ]
                                                     ),
                                                     If(
                                                         elements=[
                                                             ColorConditions.is_blank(),
                                                             StyleConditions.is_blank(),
                                                             Output(
                                                                 prompt=Prompt(
                                                                     items=["for ALL {Recency_Preference} movies."]),
                                                                 children=[AfterSearchResults.goto()]
                                                             )
                                                         ]
                                                     ),
                                                     Output(
                                                         Prompt(items=[
                                                             "for {Recency_Preference} {Certification_Preference}-rated {Genre_Preference} movies."]),
                                                         children=[AfterSearchResults.goto()]
                                                     )
                                                 ]
                                             )
                                         ]
                                     )
                                 ]
                             )
                         ]
                     )
                 ]
             )
         ]
     )
Exemple #2
0
 def create():
     return Input(
         grammar=Grammar(items=["more", "$ more", "$ next", "$ forward"]),
         children=[
             Action(var_name="Show_Next", operator="SET_TO_YES"),
             PageAction.set_to_next(),
             Output(
                 Prompt(items=["Okay."]),
                 children=[
                     Output(Prompt(
                         "\"{Search_Now:\"{Search_Now}\", Color:\"{Color_Preference}\", Style:\"{Style_Preference}\", Index:\"{Current_Index}\", Page:\"{Page}\", Total_Movies:\"{%s}\", Total_Pages:\"{Total_Pages}\"}\""
                         % NAME_RESULTS_COUNT),
                            children=[
                                Action(var_name="First_Results",
                                       operator="SET_TO_NO"),
                                GetUserInput(
                                    _id="getUserInput_2503174",
                                    children=[
                                        Input(
                                            grammar=Grammar(items=[
                                                "UPDATE CURRENT_INDEX"
                                            ]),
                                            children=[
                                                Action(
                                                    var_name="Show_Next",
                                                    operator="SET_TO_NO"),
                                                Action(
                                                    var_name="Show_Previous",
                                                    operator="SET_TO_NO"),
                                                If(elements=[
                                                    Condition(
                                                        name="Last_Results",
                                                        operator=
                                                        "EQUAL_TO_YES"),
                                                    Output(prompt=Prompt(
                                                        items=
                                                        "Those were the last results"
                                                    ),
                                                           children=[
                                                               Goto(
                                                                   ref=
                                                                   "profileCheck_2503183"
                                                               )
                                                           ])
                                                ]),
                                                If(elements=[
                                                    Condition(
                                                        name="Current_Index",
                                                        operator="EQUALS",
                                                        root_text="{%s}" %
                                                        NAME_RESULTS_COUNT),
                                                    Output(
                                                        prompt=Prompt(
                                                            items=[
                                                                "Here are the last results"
                                                            ]),
                                                        children=[
                                                            Action(
                                                                var_name=
                                                                "Last_Results",
                                                                operator=
                                                                "SET_TO_YES"
                                                            ),
                                                            Goto(
                                                                ref=
                                                                "profileCheck_2503183"
                                                            )
                                                        ])
                                                ]),
                                                Output(
                                                    prompt=Prompt(items=[
                                                        "Here is the next set of results"
                                                    ]),
                                                    children=[
                                                        If(elements=[
                                                            StyleConditions.
                                                            is_blank(),
                                                            ColorConditions.
                                                            has_value(),
                                                            Output(
                                                                prompt=
                                                                Prompt(items=[
                                                                    "for {Style_Preference} {Color_Preference}-rated movies."
                                                                ]),
                                                                children=[
                                                                    AfterSearchResults
                                                                    .goto()
                                                                ])
                                                        ],
                                                           _id=
                                                           "profileCheck_2503183"
                                                           ),
                                                        If(elements=[
                                                            ColorConditions.
                                                            is_blank(),
                                                            StyleConditions.
                                                            has_value(),
                                                            Output(
                                                                Prompt(
                                                                    items=[
                                                                        "for {Recency_Preference} {Genre_Preference} movies."
                                                                    ]),
                                                                children=[
                                                                    AfterSearchResults
                                                                    .goto()
                                                                ])
                                                        ]),
                                                        If(elements=[
                                                            ColorConditions.
                                                            is_blank(),
                                                            StyleConditions.
                                                            is_blank(),
                                                            Output(
                                                                prompt=
                                                                Prompt(items=[
                                                                    "for ALL {Recency_Preference} movies."
                                                                ]),
                                                                children=[
                                                                    AfterSearchResults
                                                                    .goto()
                                                                ])
                                                        ]),
                                                        Output(Prompt(items=[
                                                            "for {Recency_Preference} {Certification_Preference}-rated {Genre_Preference} movies."
                                                        ]),
                                                               children=[
                                                                   AfterSearchResults
                                                                   .goto()
                                                               ])
                                                    ])
                                            ])
                                    ])
                            ])
                 ])
         ])