forked from slackapi/python-slack-sdk
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revise WebClient/RTMClient internals for run_async=False
* slackapi#530 Fixed by changing _execute_in_thread to be a coroutine * slackapi#569 Resolved by removing a blocking loop (while future.running()) * slackapi#645 WebClient(run_async=False) no longer depends on asyncio by default * slackapi#633 WebClient(run_async=False) doesn't internally depend on aiohttp * slackapi#631 When run_async=True, RTM listner can be a normal function and WebClient is free from the event loop * slackapi#630 WebClient no longer depends on aiohttp when run_async=False * slackapi#497 Fixed when run_async=False / can be closed as we don't support run_async=True for this use case (in Flask)
- Loading branch information
Showing
5 changed files
with
395 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import platform | ||
import sys | ||
|
||
import slack.version as ver | ||
|
||
|
||
def get_user_agent(): | ||
"""Construct the user-agent header with the package info, | ||
Python version and OS version. | ||
Returns: | ||
The user agent string. | ||
e.g. 'Python/3.6.7 slackclient/2.0.0 Darwin/17.7.0' | ||
""" | ||
# __name__ returns all classes, we only want the client | ||
client = "{0}/{1}".format("slackclient", ver.__version__) | ||
python_version = "Python/{v.major}.{v.minor}.{v.micro}".format(v=sys.version_info) | ||
system_info = "{0}/{1}".format(platform.system(), platform.release()) | ||
user_agent_string = " ".join([python_version, client, system_info]) | ||
return user_agent_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.