Skip to content

Commit 8703ddb

Browse files
author
Michael Miele
committed
Update oauth_prompt.py
Code comments formatting and replaced remarks with note in methods.
1 parent bb83c82 commit 8703ddb

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232

3333

3434
class OAuthPrompt(Dialog):
35-
"""Creates a new prompt for the user to sign in
36-
Creates a new prompt that asks the user to sign in using the Bot Framework Single Sign On (SSO) service.
35+
"""
36+
Creates a new prompt that asks the user to sign in, using the Bot Framework Single Sign On (SSO) service.
3737
3838
.. remarks::
3939
The prompt will attempt to retrieve the users current token and if the user isn't signed in, it
@@ -67,17 +67,17 @@ def __init__(
6767
settings: OAuthPromptSettings,
6868
validator: Callable[[PromptValidatorContext], Awaitable[bool]] = None,
6969
):
70-
""" Creates a :class:`OAuthPrompt` instance
70+
"""
7171
Creates a new instance of the :class:`OAuthPrompt` class.
7272
7373
:param dialogId: The Id to assign to this prompt.
7474
:type dialogId: str
75-
:param settings: Additional authentication settings to use with this instance of the prompt.
75+
:param settings: Additional authentication settings to use with this instance of the prompt
7676
:type settings: :class:`OAuthPromptSettings`
77-
:param validator: Optional, a :class:`PromptValidator` that contains additional, custom validation for this prompt.
77+
:param validator: Optional, a :class:`PromptValidator` that contains additional, custom validation for this prompt
7878
:type validator: :class:`PromptValidatorContext`
7979
80-
.. remarks::
80+
.. note::
8181
The value of :param dialogId: must be unique within the :class:`DialogSet`or :class:`ComponentDialog` to which the prompt is added.
8282
"""
8383
super().__init__(dialog_id)
@@ -94,19 +94,18 @@ def __init__(
9494
async def begin_dialog(
9595
self, dialog_context: DialogContext, options: PromptOptions = None
9696
) -> DialogTurnResult:
97-
""" Starts an authentication prompt dialog.
98-
Called when an authentication prompt dialog is pushed onto the dialog stack and is being activated.
97+
"""
98+
Starts an authentication prompt dialog. Called when an authentication prompt dialog is pushed onto the dialog stack and is being activated.
9999
100-
:param dialog_context: The dialog context for the current turn of the conversation.
100+
:param dialog_context: The dialog context for the current turn of the conversation
101101
:type dialog_context: :class:`DialogContext`
102-
:param options: Optional, additional information to pass to the prompt being started.
102+
:param options: Optional, additional information to pass to the prompt being started
103103
:type options: :class:PromptOptions
104104
:return: Dialog turn result
105105
:rtype: :class:DialogTurnResult
106106
107-
.. remarks::
108-
If the task is successful, the result indicates whether the prompt is still active
109-
after the turn has been processed by the prompt.
107+
.. note::
108+
If the task is successful, the result indicates whether the prompt is still active after the turn has been processed by the prompt.
110109
"""
111110
if dialog_context is None:
112111
raise TypeError(
@@ -149,15 +148,15 @@ async def begin_dialog(
149148
return Dialog.end_of_turn
150149

151150
async def continue_dialog(self, dialog_context: DialogContext) -> DialogTurnResult:
152-
""" Continues a dialog.
153-
Called when a prompt dialog is the active dialog and the user replied with a new activity.
151+
"""
152+
Continues a dialog. Called when a prompt dialog is the active dialog and the user replied with a new activity.
154153
155-
:param dialog_context: The dialog context for the current turn of the conversation.
154+
:param dialog_context: The dialog context for the current turn of the conversation
156155
:type dialog_context: :class:`DialogContext`
157156
:return: Dialog turn result
158157
:rtype: :class:DialogTurnResult
159158
160-
.. remarks::
159+
.. note::
161160
If the task is successful, the result indicates whether the dialog is still
162161
active after the turn has been processed by the dialog.
163162
The prompt generally continues to receive the user's replies until it accepts the
@@ -210,15 +209,15 @@ async def continue_dialog(self, dialog_context: DialogContext) -> DialogTurnResu
210209
async def get_user_token(
211210
self, context: TurnContext, code: str = None
212211
) -> TokenResponse:
213-
"""Gets the user's token
214-
Attempts to get the user's token.
212+
"""
213+
Gets the user's tokeN.
215214
216-
:param context: Context for the current turn of conversation with the user.
215+
:param context: Context for the current turn of conversation with the user
217216
:type context: :class:TurnContext
218217
:return: A response that includes the user's token
219218
:rtype: :class:TokenResponse
220219
221-
.. remarks::
220+
.. note::
222221
If the task is successful and the user already has a token or the user successfully signs in,
223222
the result contains the user's token.
224223
"""
@@ -235,14 +234,15 @@ async def get_user_token(
235234
)
236235

237236
async def sign_out_user(self, context: TurnContext):
238-
"""Signs out the user
237+
"""
238+
Signs out the user
239239
240-
:param context: Context for the current turn of conversation with the user.
240+
:param context: Context for the current turn of conversation with the user
241241
:type context: :class:`TurnContext`
242-
:return: A :class:`Task` representing the work queued to execute.
242+
:return: A :class:`Task` representing the work queued to execute
243243
:rtype: :class:`Task`
244244
245-
.. remarks::
245+
.. note::
246246
If the task is successful and the user already has a token or the user successfully signs in,
247247
the result contains the user's token.
248248
"""

0 commit comments

Comments
 (0)