Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: asyncio integration #152

Merged
merged 11 commits into from
Feb 21, 2025
Merged

feat!: asyncio integration #152

merged 11 commits into from
Feb 21, 2025

Conversation

linkfrg
Copy link
Owner

@linkfrg linkfrg commented Feb 16, 2025

PyGObject 3.50.0 introduces asyncio integration with support to await Gio async functions.
This makes working with Gio's asynchronous functions much easier by providing a convenient pythonic API.
This PR is aimed at adding integration with asyncio and rewriting async stuff to the asyncio style.

  • Bump the minimal required PyGObject version to 3.50.0
  • DBusProxy
  • Network Service
  • Bluetooth Service
  • Widget.FileDialog
  • Update docstrings
  • log runtime warnings (e.g., coroutine was never awaited) (done by 4507ffb in main)
  • docs: Add a page describing how to work with asynchronous functions and asyncio

Affected (public) functions:

  • DBusProxy
    • new_async()
    • get_dbus_property_async()
    • set_dbus_property_async()
  • BluetoothDevice
    • connect_to()
    • disconnect_from()
  • WifiAccessPoint
    • commit_changes_async()
    • connect_to()
    • connect_to_graphical()
    • disconnect_from()
    • forget()
  • EthernetDevice
    • connect_to()
    • disconnect_from()
  • VpnConnection
    • connect_to()
    • disconnect_from()
  • WifiDevice
    • scan()
  • Utils.exec_sh_async()
  • Utils.read_file_async()
  • Utils.write_file_async()
  • Widget.FileDialog.open_dialog()

Now these functions are asynchronous. Use await or asyncio.create_task() to call them. More information on the corresponding page in the documentation

@linkfrg linkfrg marked this pull request as ready for review February 21, 2025 18:58
@linkfrg linkfrg merged commit eff1698 into main Feb 21, 2025
1 check passed
@linkfrg linkfrg deleted the feat/asyncio branch February 21, 2025 18:59
linkfrg added a commit to linkfrg/dotfiles that referenced this pull request Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant