Skip to content

Commit 3fcc356

Browse files
authored
Merge pull request #716 from microsoft/api-ref-fixes-r3
API ref doc fixes round 3
2 parents b2d96e1 + eea83e0 commit 3fcc356

File tree

2 files changed

+36
-51
lines changed

2 files changed

+36
-51
lines changed

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

Lines changed: 35 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515

1616
class ComponentDialog(Dialog):
1717
"""
18-
A :class:`Dialog` that is composed of other dialogs
19-
20-
A component dialog has an inner :class:`DialogSet` :class:`DialogContext`,
21-
which provides an inner dialog stack that is hidden from the parent dialog.
18+
A :class:`botbuilder.dialogs.Dialog` that is composed of other dialogs
2219
2320
:var persisted_dialog state:
2421
:vartype persisted_dialog_state: str
@@ -52,12 +49,12 @@ async def begin_dialog(
5249
If the task is successful, the result indicates whether the dialog is still
5350
active after the turn has been processed by the dialog.
5451
55-
:param dialog_context: The :class:`DialogContext` for the current turn of the conversation.
56-
:type dialog_context: :class:`DialogContext`
52+
:param dialog_context: The :class:`botbuilder.dialogs.DialogContext` for the current turn of the conversation.
53+
:type dialog_context: :class:`botbuilder.dialogs.DialogContext`
5754
:param options: Optional, initial information to pass to the dialog.
5855
:type options: object
5956
:return: Signals the end of the turn
60-
:rtype: :class:`Dialog.end_of_turn`
57+
:rtype: :class:`botbuilder.dialogs.Dialog.end_of_turn`
6158
"""
6259
if dialog_context is None:
6360
raise TypeError("ComponentDialog.begin_dialog(): outer_dc cannot be None.")
@@ -88,16 +85,16 @@ async def continue_dialog(self, dialog_context: DialogContext) -> DialogTurnResu
8885
contain a return value.
8986
9087
If this method is *not* overriden the component dialog calls the
91-
:meth:`DialogContext.continue_dialog` method on it's inner dialog
88+
:meth:`botbuilder.dialogs.DialogContext.continue_dialog` method on it's inner dialog
9289
context. If the inner dialog stack is empty, the component dialog ends,
93-
and if a :class:`DialogTurnResult.result` is available, the component dialog
90+
and if a :var:`botbuilder.dialogs.DialogTurnResult.result` is available, the component dialog
9491
uses that as it's return value.
9592
9693
97-
:param dialog_context: The parent :class:`DialogContext` for the current turn of the conversation.
98-
:type dialog_context: :class:`DialogContext`
94+
:param dialog_context: The parent dialog context for the current turn of the conversation.
95+
:type dialog_context: :class:`botbuilder.dialogs.DialogContext`
9996
:return: Signals the end of the turn
100-
:rtype: :class:`Dialog.end_of_turn`
97+
:rtype: :var:`botbuilder.dialogs.Dialog.end_of_turn`
10198
"""
10299
if dialog_context is None:
103100
raise TypeError("ComponentDialog.begin_dialog(): outer_dc cannot be None.")
@@ -126,15 +123,14 @@ async def resume_dialog(
126123
To avoid the container prematurely ending we need to implement this method and simply
127124
ask our inner dialog stack to re-prompt.
128125
129-
:param dialog_context: The :class:`DialogContext` for the current turn of the conversation.
130-
:type dialog_context: :class:`DialogContext`
126+
:param dialog_context: The dialog context for the current turn of the conversation.
127+
:type dialog_context: :class:`botbuilder.dialogs.DialogContext`
131128
:param reason: Reason why the dialog resumed.
132-
:type reason: :class:`DialogReason`
133-
:param result: Optional, value returned from the dialog that was called. The type of the
134-
value returned is dependent on the child dialog.
129+
:type reason: :class:`botbuilder.dialogs.DialogReason`
130+
:param result: Optional, value returned from the dialog that was called.
135131
:type result: object
136132
:return: Signals the end of the turn
137-
:rtype: :class:`Dialog.end_of_turn`
133+
:rtype: :class:`botbuilder.dialogs.Dialog.end_of_turn`
138134
"""
139135

140136
await self.reprompt_dialog(dialog_context.context, dialog_context.active_dialog)
@@ -149,7 +145,7 @@ async def reprompt_dialog(
149145
:param context: The context object for this turn.
150146
:type context: :class:`botbuilder.core.TurnContext`
151147
:param instance: State information for this dialog.
152-
:type instance: :class:`DialogInstance`
148+
:type instance: :class:`botbuilder.dialogs.DialogInstance`
153149
"""
154150
# Delegate to inner dialog.
155151
dialog_state = instance.state[self.persisted_dialog_state]
@@ -167,11 +163,11 @@ async def end_dialog(
167163
168164
:param context: The context object for this turn.
169165
:type context: :class:`botbuilder.core.TurnContext`
170-
:param instance: State information associated with the instance of this component dialog
166+
:param instance: State information associated with the instance of this component dialog.
171167
on its parent's dialog stack.
172-
:type instance: :class:`DialogInstance`
168+
:type instance: :class:`botbuilder.dialogs.DialogInstance`
173169
:param reason: Reason why the dialog ended.
174-
:type reason: :class:`DialogReason`
170+
:type reason: :class:`botbuilder.dialogs.DialogReason`
175171
"""
176172
# Forward cancel to inner dialog
177173
if reason == DialogReason.CancelCalled:
@@ -185,7 +181,7 @@ def add_dialog(self, dialog: Dialog) -> object:
185181
Adds a :class:`Dialog` to the component dialog and returns the updated component.
186182
187183
:param dialog: The dialog to add.
188-
:return: The updated :class:`ComponentDialog`
184+
:return: The updated :class:`ComponentDialog`.
189185
:rtype: :class:`ComponentDialog`
190186
"""
191187
self._dialogs.add(dialog)
@@ -199,7 +195,7 @@ def find_dialog(self, dialog_id: str) -> Dialog:
199195
200196
:param dialog_id: The dialog to add.
201197
:return: The dialog; or None if there is not a match for the ID.
202-
:rtype: :class:Dialog
198+
:rtype: :class:`botbuilder.dialogs.Dialog`
203199
"""
204200
return self._dialogs.find(dialog_id)
205201

@@ -213,13 +209,13 @@ async def on_begin_dialog(
213209
If the task is successful, the result indicates whether the dialog is still
214210
active after the turn has been processed by the dialog.
215211
216-
By default, this calls the :meth:`Dialog.begin_dialog()` method of the component
217-
dialog's initial dialog.
212+
By default, this calls the :meth:`botbuilder.dialogs.Dialog.begin_dialog()`
213+
method of the component dialog's initial dialog.
218214
219215
Override this method in a derived class to implement interrupt logic.
220216
221-
:param inner_dc: The inner :class:`DialogContext` for the current turn of conversation.
222-
:type inner_dc: :class:`DialogContext`
217+
:param inner_dc: The inner dialog context for the current turn of conversation.
218+
:type inner_dc: :class:`botbuilder.dialogs.DialogContext`
223219
:param options: Optional, initial information to pass to the dialog.
224220
:type options: object
225221
"""
@@ -229,8 +225,8 @@ async def on_continue_dialog(self, inner_dc: DialogContext) -> DialogTurnResult:
229225
"""
230226
Called when the dialog is continued, where it is the active dialog and the user replies with a new activity.
231227
232-
:param inner_dc: The inner :class:`DialogContext` for the current turn of conversation.
233-
:type inner_dc: :class:`DialogContext`
228+
:param inner_dc: The inner dialog context for the current turn of conversation.
229+
:type inner_dc: :class:`botbuilder.dialogs.DialogContext`
234230
"""
235231
return await inner_dc.continue_dialog()
236232

@@ -242,11 +238,10 @@ async def on_end_dialog( # pylint: disable=unused-argument
242238
243239
:param turn_context: The :class:`botbuilder.core.TurnContext` for the current turn of the conversation.
244240
:type turn_context: :class:`botbuilder.core.TurnContext`
245-
:param instance: State information associated with the instance of this component dialog on
246-
its parent's dialog stack.
247-
:type instance: :class:`DialogInstance`
241+
:param instance: State information associated with the inner dialog stack of this component dialog.
242+
:type instance: :class:`botbuilder.dialogs.DialogInstance`
248243
:param reason: Reason why the dialog ended.
249-
:type reason: :class:`DialogReason`
244+
:type reason: :class:`botbuilder.dialogs.DialogReason`
250245
"""
251246
return
252247

@@ -255,10 +250,9 @@ async def on_reprompt_dialog( # pylint: disable=unused-argument
255250
) -> None:
256251
"""
257252
:param turn_context: The :class:`botbuilder.core.TurnContext` for the current turn of the conversation.
258-
:type turn_context: :class:`DialogInstance`
259-
:param instance: State information associated with the instance of this component dialog
260-
on its parent's dialog stack.
261-
:type instance: :class:`DialogInstance`
253+
:type turn_context: :class:`botbuilder.dialogs.DialogInstance`
254+
:param instance: State information associated with the inner dialog stack of this component dialog.
255+
:type instance: :class:`botbuilder.dialogs.DialogInstance`
262256
"""
263257
return
264258

@@ -272,20 +266,11 @@ async def end_component(
272266
If the task is successful, the result indicates that the dialog ended after the
273267
turn was processed by the dialog.
274268
275-
In general, the parent context is the dialog or bot turn handler that started the dialog.
276-
If the parent is a dialog, the stack calls the parent's :meth:`Dialog.resume_dialog()` method
277-
to return a result to the parent dialog. If the parent dialog does not implement
278-
:meth:`Dialog.resume_dialog()`, then the parent will end, too, and the result is passed to the next
279-
parent context, if one exists.
280-
281-
The returned :class:`DialogTurnResult`contains the return value in its
282-
:class:`DialogTurnResult.result` property.
283-
284-
:param outer_dc: The parent class:`DialogContext` for the current turn of conversation.
285-
:type outer_dc: class:`DialogContext`
269+
:param outer_dc: The parent dialog context for the current turn of conversation.
270+
:type outer_dc: class:`botbuilder.dialogs.DialogContext`
286271
:param result: Optional, value to return from the dialog component to the parent context.
287272
:type result: object
288273
:return: Value to return.
289-
:rtype: :class:`DialogTurnResult.result`
274+
:rtype: :var:`botbuilder.dialogs.DialogTurnResult.result`
290275
"""
291276
return await outer_dc.end_dialog(result)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class DialogTurnResult:
1212
def __init__(self, status: DialogTurnStatus, result: object = None):
1313
"""
1414
:param status: The current status of the stack.
15-
:type status: :class:`DialogTurnStatus`
15+
:type status: :class:`botbuilder.dialogs.DialogTurnStatus`
1616
:param result: The result returned by a dialog that was just ended.
1717
:type result: object
1818
"""

0 commit comments

Comments
 (0)