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

[BUG] expose throws an error #80

Closed
Sombrer0Dev opened this issue Apr 15, 2024 · 2 comments
Closed

[BUG] expose throws an error #80

Sombrer0Dev opened this issue Apr 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Sombrer0Dev
Copy link

Pyprland version
2.2.6-3

Describe the bug
expose plugin throws an AttributeError:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pyprland/command.py", line 191, in _run_plugin_handler
    await getattr(plugin, full_name)(*params)
  File "/usr/lib/python3.11/site-packages/pyprland/plugins/expose.py", line 32, in run_expose
    commands.extend(
    ^^^^^^^^^^^^^^^
AttributeError: 'coroutine' object has no attribute 'extend'

To Reproduce
Steps to reproduce the behavior:

  1. Use pypr expose command

Expected behavior
Behavior like in expose demo

Configuration (provide following files/samples when relevant):
Pyprland:

Hyprland:

@Sombrer0Dev Sombrer0Dev added the bug Something isn't working label Apr 15, 2024
@fdev31
Copy link
Collaborator

fdev31 commented Apr 15, 2024

Oh sorry, I broke it with a recent change, I'll update it soon but in the meantime if you don't want to be bothered, just remove the "async" in move_clients_to_workspace:

diff --git a/pyprland/plugins/expose.py b/pyprland/plugins/expose.py
index 94f8af3..79b976f 100644
--- a/pyprland/plugins/expose.py
+++ b/pyprland/plugins/expose.py
@@ -15,7 +15,7 @@ class Extension(CastBoolMixin, Plugin):  # pylint: disable=missing-class-docstri
             return self.exposed_clients_list
         return [c for c in self.exposed_clients_list if c["workspace"]["id"] > 0]
 
-    async def move_clients_to_workspace(self, workspace, clients):
+    def move_clients_to_workspace(self, workspace, clients):
         """Move clients to a workspace"""
         return [
             f"movetoworkspacesilent {workspace},address:{client['address']}"

@fdev31
Copy link
Collaborator

fdev31 commented Apr 15, 2024

It was more complex than this, I tested copilot recently and didn't review the code carefully enough, it was completely broken.
I pushed a new release reverting the "optimizations" of the expose plugin.
Re-open if I missed something and thank you again for the quick report!

@fdev31 fdev31 closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants