Skip to content

Commit a68c5e8

Browse files
committed
More pylint corrections
1 parent 5a6e6fb commit a68c5e8

4 files changed

Lines changed: 57 additions & 38 deletions

File tree

libraries/botbuilder-core/botbuilder/core/activity_handler.py

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ async def on_turn(self, turn_context: TurnContext):
2323
In a derived class, override this method to add logic that applies to all activity types.
2424
2525
.. note::
26-
- Add logic to apply before the type-specific logic and before the call to the :meth:`ActivityHandler.on_turn()` method.
27-
- Add logic to apply after the type-specific logic after the call to the :meth:`ActivityHandler.on_turn()` method.
26+
- Add logic to apply before the type-specific logic and before the call to the
27+
:meth:`ActivityHandler.on_turn()` method.
28+
- Add logic to apply after the type-specific logic after the call to the
29+
:meth:`ActivityHandler.on_turn()` method.
2830
"""
2931
if turn_context is None:
3032
raise TypeError("ActivityHandler.on_turn(): turn_context cannot be None.")
@@ -72,15 +74,17 @@ async def on_message_activity( # pylint: disable=unused-argument
7274

7375
async def on_conversation_update_activity(self, turn_context: TurnContext):
7476
"""
75-
Invoked when a conversation update activity is received from the channel when the base behavior of :meth:`ActivityHandler.on_turn()` is used.
77+
Invoked when a conversation update activity is received from the channel when the base behavior of
78+
:meth:`ActivityHandler.on_turn()` is used.
7679
7780
:param turn_context: The context object for this turn
7881
:type turn_context: :class:`TurnContext`
7982
8083
:returns: A task that represents the work queued to execute
8184
8285
.. note::
83-
When the :meth:'ActivityHandler.on_turn()` method receives a conversation update activity, it calls this method.
86+
When the :meth:'ActivityHandler.on_turn()` method receives a conversation update activity, it calls this
87+
method.
8488
If the conversation update activity indicates that members other than the bot joined the conversation,
8589
it calls the :meth:`ActivityHandler.on_members_added_activity()` method.
8690
If the conversation update activity indicates that members other than the bot left the conversation,
@@ -108,18 +112,20 @@ async def on_members_added_activity(
108112
self, members_added: List[ChannelAccount], turn_context: TurnContext
109113
): # pylint: disable=unused-argument
110114
"""
111-
Override this method in a derived class to provide logic for when members other than the bot join the conversation.
112-
You can add your bot's welcome logic.
115+
Override this method in a derived class to provide logic for when members other than the bot join
116+
the conversation. You can add your bot's welcome logic.
113117
114-
:param members_added: A list of all the members added to the conversation, as described by the conversation update activity
118+
:param members_added: A list of all the members added to the conversation, as described by the
119+
conversation update activity
115120
:type members_added: :class:`typing.List`
116121
:param turn_context: The context object for this turn
117122
:type turn_context: :class:`TurnContext`
118123
119124
:returns: A task that represents the work queued to execute
120125
121126
.. note::
122-
When the :meth:'ActivityHandler.on_conversation_update_activity()` method receives a conversation update activity that indicates
127+
When the :meth:'ActivityHandler.on_conversation_update_activity()` method receives a conversation
128+
update activity that indicates
123129
one or more users other than the bot are joining the conversation, it calls this method.
124130
"""
125131
return
@@ -128,43 +134,50 @@ async def on_members_removed_activity(
128134
self, members_removed: List[ChannelAccount], turn_context: TurnContext
129135
): # pylint: disable=unused-argument
130136
"""
131-
Override this method in a derived class to provide logic for when members other than the bot leave the conversation.
132-
You can add your bot's good-bye logic.
137+
Override this method in a derived class to provide logic for when members other than the bot leave
138+
the conversation. You can add your bot's good-bye logic.
133139
134-
:param members_added: A list of all the members removed from the conversation, as described by the conversation update activity
140+
:param members_added: A list of all the members removed from the conversation, as described by the
141+
conversation update activity
135142
:type members_added: :class:`typing.List`
136143
:param turn_context: The context object for this turn
137144
:type turn_context: :class:`TurnContext`
138145
139146
:returns: A task that represents the work queued to execute
140147
141148
.. note::
142-
When the :meth:'ActivityHandler.on_conversation_update_activity()` method receives a conversation update activity that indicates
143-
one or more users other than the bot are leaving the conversation, it calls this method.
149+
When the :meth:'ActivityHandler.on_conversation_update_activity()` method receives a conversation
150+
update activity that indicates one or more users other than the bot are leaving the conversation,
151+
it calls this method.
144152
"""
145153

146154
return
147155

148156
async def on_message_reaction_activity(self, turn_context: TurnContext):
149157
"""
150-
Invoked when an event activity is received from the connector when the base behavior of :meth:'ActivityHandler.on_turn()` is used.
151-
158+
Invoked when an event activity is received from the connector when the base behavior of
159+
:meth:'ActivityHandler.on_turn()` is used.
152160
153161
:param turn_context: The context object for this turn
154162
:type turn_context: :class:`TurnContext`
155163
156164
:returns: A task that represents the work queued to execute
157165
158166
.. note::
159-
Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) to a previously sent activity.
160-
Message reactions are only supported by a few channels. The activity that the message reaction corresponds to is indicated in the
161-
reply to Id property. The value of this property is the activity id of a previously sent activity given back to the bot as the response
162-
from a send call.
163-
When the :meth:'ActivityHandler.on_turn()` method receives a message reaction activity, it calls this method.
164-
If the message reaction indicates that reactions were added to a message, it calls :meth:'ActivityHandler.on_reaction_added().
165-
If the message reaction indicates that reactions were removed from a message, it calls :meth:'ActivityHandler.on_reaction_removed().
167+
Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) to a previously
168+
sent activity.
169+
Message reactions are only supported by a few channels. The activity that the message reaction corresponds
170+
to is indicated in the reply to Id property. The value of this property is the activity id of a previously
171+
sent activity given back to the bot as the response from a send call.
172+
When the :meth:'ActivityHandler.on_turn()` method receives a message reaction activity, it calls this
173+
method.
174+
If the message reaction indicates that reactions were added to a message, it calls
175+
:meth:'ActivityHandler.on_reaction_added().
176+
If the message reaction indicates that reactions were removed from a message, it calls
177+
:meth:'ActivityHandler.on_reaction_removed().
166178
In a derived class, override this method to add logic that applies to all message reaction activities.
167-
Add logic to apply before the reactions added or removed logic before the call to the this base class method.
179+
Add logic to apply before the reactions added or removed logic before the call to the this base class
180+
method.
168181
Add logic to apply after the reactions added or removed logic after the call to the this base class method.
169182
"""
170183
if turn_context.activity.reactions_added is not None:
@@ -225,7 +238,8 @@ async def on_reactions_removed( # pylint: disable=unused-argument
225238

226239
async def on_event_activity(self, turn_context: TurnContext):
227240
"""
228-
Invoked when an event activity is received from the connector when the base behavior of :meth:'ActivityHandler.on_turn()` is used.
241+
Invoked when an event activity is received from the connector when the base behavior of
242+
:meth:'ActivityHandler.on_turn()` is used.
229243
230244
:param turn_context: The context object for this turn
231245
:type turn_context: :class:`TurnContext`
@@ -254,7 +268,8 @@ async def on_token_response_event( # pylint: disable=unused-argument
254268
self, turn_context: TurnContext
255269
):
256270
"""
257-
Invoked when a `tokens/response` event is received when the base behavior of :meth:'ActivityHandler.on_event_activity()` is used.
271+
Invoked when a `tokens/response` event is received when the base behavior of
272+
:meth:'ActivityHandler.on_event_activity()` is used.
258273
If using an `oauth_prompt`, override this method to forward this activity to the current dialog.
259274
260275
:param turn_context: The context object for this turn
@@ -263,8 +278,9 @@ async def on_token_response_event( # pylint: disable=unused-argument
263278
:returns: A task that represents the work queued to execute
264279
265280
.. note::
266-
When the :meth:'ActivityHandler.on_event()` method receives an event with an activity name of `tokens/response`,
267-
it calls this method. If your bot uses an `oauth_prompt`, forward the incoming activity to the current dialog.
281+
When the :meth:'ActivityHandler.on_event()` method receives an event with an activity name of
282+
`tokens/response`, it calls this method. If your bot uses an `oauth_prompt`, forward the incoming
283+
activity to the current dialog.
268284
"""
269285
return
270286

@@ -304,8 +320,8 @@ async def on_unrecognized_activity_type( # pylint: disable=unused-argument
304320
self, turn_context: TurnContext
305321
):
306322
"""
307-
Invoked when an activity other than a message, conversation update, or event is received when the base behavior of
308-
:meth:`ActivityHandler.on_turn()` is used.
323+
Invoked when an activity other than a message, conversation update, or event is received when the base
324+
behavior of :meth:`ActivityHandler.on_turn()` is used.
309325
If overridden, this method could potentially respond to any of the other activity types.
310326
311327
:param turn_context: The context object for this turn
@@ -314,7 +330,7 @@ async def on_unrecognized_activity_type( # pylint: disable=unused-argument
314330
:returns: A task that represents the work queued to execute
315331
316332
.. note::
317-
When the :meth:`ActivityHandler.on_turn()` method receives an activity that is not a message, conversation update, message reaction,
318-
or event activity, it calls this method.
333+
When the :meth:`ActivityHandler.on_turn()` method receives an activity that is not a message,
334+
conversation update, message reaction, or event activity, it calls this method.
319335
"""
320336
return

libraries/botbuilder-core/botbuilder/core/bot_framework_adapter.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def __init__(
9090
:param app_id: The bot application ID. This is the appId returned by the Azure portal registration, and is
9191
the value of the `MicrosoftAppId` parameter in the `config.py` file.
9292
:type app_id: str
93-
:param app_password: The bot application password. This is the password returned by the Azure portal registration, and is
93+
:param app_password: The bot application password. This is the password returned by the Azure portal
94+
registration, and is
9495
the value os the `MicrosoftAppPassword` parameter in the `config.py` file.
9596
:type app_password: str
9697
:param channel_auth_tenant: The channel tenant to use in conversation
@@ -674,7 +675,8 @@ async def get_conversations(self, service_url: str, continuation_token: str = No
674675
returns results in pages and each page will include a `continuationToken` that can be used to fetch the next
675676
page of results from the server.
676677
677-
:param service_url: The URL of the channel server to query. This can be retrieved from `context.activity.serviceUrl`
678+
:param service_url: The URL of the channel server to query. This can be retrieved from
679+
`context.activity.serviceUrl`
678680
:type service_url: str
679681
680682
:param continuation_token: The continuation token from the previous page of results
@@ -684,8 +686,10 @@ async def get_conversations(self, service_url: str, continuation_token: str = No
684686
685687
:return: A task that represents the work queued to execute
686688
687-
.. note:: If the task completes successfully, the result contains a page of the members of the current conversation.
688-
This overload may be called from outside the context of a conversation, as only the bot's service URL and credentials are required.
689+
.. note:: If the task completes successfully, the result contains a page of the members of the current
690+
conversation.
691+
This overload may be called from outside the context of a conversation, as only the bot's service URL and
692+
credentials are required.
689693
"""
690694
client = await self.create_connector_client(service_url)
691695
return await client.conversations.get_conversations(continuation_token)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class DialogReason(Enum):
1313
:vartype ContinueCalled: int
1414
:var EndCalled: A dialog ended normally through a call to `DialogContext.end_dialog()
1515
:vartype EndCalled: int
16-
:var ReplaceCalled: A dialog is ending because it's being replaced through a call to `DialogContext.replace_dialog()`.
16+
:var ReplaceCalled: A dialog is ending because it's being replaced through a call to
17+
`DialogContext.replace_dialog()`.
1718
:vartype ReplacedCalled: int
1819
:var CancelCalled: A dialog was cancelled as part of a call to `DialogContext.cancel_all_dialogs()`.
1920
:vartype CancelCalled: int

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ async def on_prompt(
215215
:return: A :class:Task representing the asynchronous operation.
216216
:rtype: :class:Task
217217
"""
218-
pass
219218

220219
@abstractmethod
221220
async def on_recognize(
@@ -238,7 +237,6 @@ async def on_recognize(
238237
:return: A :class:Task representing the asynchronous operation.
239238
:rtype: :class:Task
240239
"""
241-
pass
242240

243241
def append_choices(
244242
self,

0 commit comments

Comments
 (0)