8000 Merge branch 'master' into mm-api-ref-docs-fixes-wip · TheCompuGuru/botbuilder-python@5b04a16 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b04a16

Browse files
authored
Merge branch 'master' into mm-api-ref-docs-fixes-wip
2 parents 5cc177f + 2127e7f commit 5b04a16

File tree

5 files changed

+31
-34
lines changed

5 files changed

+31
-34
lines changed

libraries/botbuilder-dialogs/botbuilder/dialogs/component_dialog.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def continue_dialog(self, dialog_context: DialogContext) -> DialogTurnResu
8282
Called when the dialog is continued, where it is the active dialog and the
8383
user replies with a new activity.
8484
85-
.. note::
85+
.. remarks::
8686
If the task is successful, the result indicates whether the dialog is still
8787
active after the turn has been processed by the dialog. The result may also
8888
contain a return value.
@@ -119,23 +119,13 @@ async def resume_dialog(
119119
Called when a child dialog on the parent's dialog stack completed this turn, returning
120120
control to this dialog component.
121121
122-
.. note::
122+
.. remarks::
123123
Containers are typically leaf nodes on the stack but the dev is free to push other dialogs
124124
on top of the stack which will result in the container receiving an unexpected call to
125-
:meth:resume_dialog() when the pushed on dialog ends.
125+
:meth:`ComponentDialog.resume_dialog()` when the pushed on dialog ends.
126126
To avoid the container prematurely ending we need to implement this method and simply
127127
ask our inner dialog stack to re-prompt.
128128
129-
If the task is successful, the result indicates whether this dialog is still
130-
active after this dialog turn has been processed.
131-
132-
Generally, the child dialog was started with a call to :meth:`def async begin_dialog()`
133-
in the parent's context. However, if the :meth:`DialogContext.replace_dialog()` method is
134-
is called, the logical child dialog may be different than the original.
135-
136-
If this method is *not* overridden, the dialog automatically calls its
137-
:meth:`asyn def reprompt_dialog()` when the user replies.
138-
139129
:param dialog_context: The :class:`DialogContext` for the current turn of the conversation.
140130
:type dialog_context: :class:`DialogContext`
141131
:param reason: Reason why the dialog resumed.
@@ -157,7 +147,7 @@ async def reprompt_dialog(
157147
Called when the dialog should re-prompt the user for input.
158148
159149
:param context: The context object for this turn.
160-
:type context: :class:`TurnContext`
150+
:type context: :class:`botbuilder.core.TurnContext`
161151
:param instance: State information for this dialog.
162152
:type instance: :class:`DialogInstance`
163153
"""
@@ -176,7 +166,7 @@ async def end_dialog(
176166
Called when the dialog is ending.
177167
178168
:param context: The context object for this turn.
179-
:type context: :class:`TurnContext`
169+
:type context: :class:`botbuilder.core.TurnContext`
180170
:param instance: State information associated with the instance of this component dialog
181171
on its parent's dialog stack.
182172
:type instance: :class:`DialogInstance`
@@ -193,7 +183,6 @@ async def end_dialog(
193183
def add_dialog(self, dialog: Dialog) -> object:
194184
"""
195185
Adds a :class:`Dialog` to the component dialog and returns the updated component.
196-
Adding a new dialog will inherit the :class:`BotTelemetryClient` of the :class:`ComponentDialog`.
197186
198187
:param dialog: The dialog to add.
199188
:return: The updated :class:`ComponentDialog`
@@ -220,7 +209,7 @@ async def on_begin_dialog(
220209
"""
221210
Called when the dialog is started and pushed onto the parent's dialog stack.
222211
223-
.. note::
212+
.. remarks::
224213
If the task is successful, the result indicates whether the dialog is still
225214
active after the turn has been processed by the dialog.
226215
@@ -237,6 +226,12 @@ async def on_begin_dialog(
237226
return await inner_dc.begin_dialog(self.initial_dialog_id, options)
238227

239228
async def on_continue_dialog(self, inner_dc: DialogContext) -> DialogTurnResult:
229+
"""
230+
Called when the dialog is continued, where it is the active dialog and the user replies with a new activity.
231+
232+
:param inner_dc: The inner :class:`DialogContext` for the current turn of conversation.
233+
:type inner_dc: :class:`DialogContext`
234+
"""
240235
return await inner_dc.continue_dialog()
241236

242237
async def on_end_dialog( # pylint: disable=unused-argument
@@ -245,8 +240,8 @@ async def on_end_dialog( # pylint: disable=unused-argument
245240
"""
246241
Ends the component dialog in its parent's context.
247242
248-
:param turn_context: The :class:`TurnContext` for the current turn of the conversation.
249-
:type turn_context: :class:`TurnContext`
243+
:param turn_context: The :class:`botbuilder.core.TurnContext` for the current turn of the conversation.
244+
:type turn_context: :class:`botbuilder.core.TurnContext`
250245
:param instance: State information associated with the instance of this component dialog on
251246
its parent's dialog stack.
252247
:type instance: :class:`DialogInstance`
@@ -259,7 +254,7 @@ async def on_reprompt_dialog( # pylint: disable=unused-argument
259254
self, turn_context: TurnContext, instance: DialogInstance
260255
) -> None:
261256
"""
262-
:param turn_context: The :class:`TurnContext` for the current turn of the conversation.
257+
:param turn_context: The :class:`botbuilder.core.TurnContext` for the current turn of the conversation.
263258
:type turn_context: :class:`DialogInstance`
264259
:param instance: State information associated with the instance of this component dialog
265260
on its parent's dialog stack.
@@ -273,7 +268,7 @@ async def end_component(
273268
"""
274269
Ends the component dialog in its parent's context.
275270
276-
.. note::
271+
.. remarks::
277272
If the task is successful, the result indicates that the dialog ended after the
278273
turn was processed by the dialog.
279274

libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_reason.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class DialogReason(Enum):
99
1010
:var BeginCalled: A dialog is being started through a call to `DialogContext.begin()`.
1111
:vartype BeginCalled: int
12-
:var ContinuCalled: A dialog is being continued through a call to `DialogContext.continue_dialog()`.
12+
:var ContinueCalled: A dialog is being continued through a call to `DialogContext.continue_dialog()`.
1313
:vartype ContinueCalled: int
1414
:var EndCalled: A dialog ended normally through a call to `DialogContext.end_dialog()
1515
:vartype EndCalled: int

libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_state.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ def __init__(self, stack: List[DialogInstance] = None):
2626
@property
2727
def dialog_stack(self):
2828
"""
29-
Initializes a new instance of the :class:`DialogState` class.
29+
Initializes a new instance of the :class:`DialogState` class.
3030
31-
:return: The state information to initialize the stack with.
32-
:rtype: list
31+
:return: The state information to initialize the stack with.
32+
:rtype: list
3333
"""
3434
return self._dialog_stack
3535

libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_turn_result.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DialogTurnResult:
88
"""
99
Result returned to the caller of one of the various stack manipulation methods.
1010
11-
Use :meth:`DialogContext.end_dialogAsync()` to end a :class:`Dialog` and
11+
Use :meth:`DialogContext.end_dialog()` to end a :class:`Dialog` and
1212
return a result to the calling context.
1313
"""
1414

@@ -27,7 +27,7 @@ def status(self):
2727
"""
2828
Gets or sets the current status of the stack.
2929
30-
:return self._status:
30+
:return self._status: The status of the stack.
3131
:rtype self._status: :class:`DialogTurnStatus`
3232
"""
3333
return self._status
@@ -37,10 +37,12 @@ def result(self):
3737
"""
3838
Final result returned by a dialog that just completed.
3939
40-
.. note::
40+
.. remarks::
4141
This will only be populated in certain cases:
42-
* The bot calls :meth:`DialogContext.begin_dialog()` to start a new dialog and the dialog ends immediately.
43-
* The bot calls :meth:`DialogContext.continue_dialog()` and a dialog that was active ends.
42+
* The bot calls :meth:`DialogContext.begin_dialog()` to start a new
43+
dialog and the dialog ends immediately.
44+
* The bot calls :meth:`DialogContext.continue_dialog()` and a dialog
45+
that was active ends.
4446
4547
:return self._result: Final result returned by a dialog that just completed.
4648
:rtype self._result: object

libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/activity_prompt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ActivityPrompt(Dialog, ABC):
2424
"""
2525
Waits for an activity to be received.
2626
27-
.. remarks:
27+
.. remarks::
2828
This prompt requires a validator be passed in and is useful when waiting for non-message
2929
activities like an event to be received. The validator can ignore received events until the
3030
expected activity is received.
@@ -156,10 +156,10 @@ async def resume_dialog( # pylint: disable=unused-argument
156156
Called when a prompt dialog resumes being the active dialog on the dialog stack, such
157157
as when the previous active dialog on the stack completes.
158158
159-
.. note:
159+
.. remarks::
160160
Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs
161161
on top of the stack which will result in the prompt receiving an unexpected call to
162-
:meth:resume_dialog() when the pushed on dialog ends.
162+
:meth:`ActivityPrompt.resume_dialog()` when the pushed on dialog ends.
163163
To avoid the prompt prematurely ending, we need to implement this method and
164164
simply re-prompt the user.
165165
@@ -212,7 +212,7 @@ async def on_recognize( # pylint: disable=unused-argument
212212
When overridden in a derived class, attempts to recognize the incoming activity.
213213
214214
:param context: Context for the current turn of conversation with the user.
215-
:type context: :class:`TurnContext`
215+
:type context: :class:`botbuilder.core.TurnContext`
216216
:param state: Contains state for the current instance of the prompt on the dialog stack.
217217
:type state: :class:`typing.Dict[str, dict]`
218218
:param options: A prompt options object

0 commit comments

Comments
 (0)
0