Skip to content

Commit

Permalink
sorted imports
Browse files Browse the repository at this point in the history
  • Loading branch information
fdev31 committed Aug 1, 2023
1 parent 895e24b commit 2eafea9
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 32 deletions.
15 changes: 7 additions & 8 deletions pyprland/command.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/bin/env python
" Pyprland - an Hyprland companion app "
import asyncio
from typing import cast
import json
import sys
import os
import importlib
import itertools
import json
import os
import sys
from typing import cast


from .ipc import get_event_stream, init as ipc_init
from .common import init_logger, get_logger, PyprError
from .common import PyprError, get_logger, init_logger
from .ipc import get_event_stream
from .ipc import init as ipc_init
from .plugins.interface import Plugin

CONTROL = f'/tmp/hypr/{ os.environ["HYPRLAND_INSTANCE_SIGNATURE"] }/.pyprland.sock'
Expand Down
2 changes: 1 addition & 1 deletion pyprland/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" Shared utilities: logging """
import os
import logging
import os

__all__ = ["DEBUG", "get_logger", "init_logger"]

Expand Down
6 changes: 3 additions & 3 deletions pyprland/ipc.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/env python
""" Interact with hyprland using sockets """
import asyncio
from logging import Logger
from typing import Any
import json
import os
from logging import Logger
from typing import Any

from .common import get_logger, PyprError
from .common import PyprError, get_logger

log: Logger | None = None

Expand Down
4 changes: 2 additions & 2 deletions pyprland/plugins/expose.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
toggle_minimized allows having an "expose" like selection of minimized windows
"""
from typing import Any, cast
from .interface import Plugin

from ..ipc import hyprctlJSON, hyprctl
from ..ipc import hyprctl, hyprctlJSON
from .interface import Plugin


class Extension(Plugin): # pylint: disable=missing-class-docstring
Expand Down
1 change: 1 addition & 0 deletions pyprland/plugins/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
" Common plugin interface "
from typing import Any

from ..common import get_logger


Expand Down
4 changes: 2 additions & 2 deletions pyprland/plugins/lost_windows.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
" Moves unreachable client windows to the currently focused workspace"
from typing import Any, cast
from .interface import Plugin

from ..ipc import hyprctlJSON, hyprctl
from ..ipc import hyprctl, hyprctlJSON
from .interface import Plugin


def contains(monitor, window):
Expand Down
3 changes: 1 addition & 2 deletions pyprland/plugins/magnify.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
" Toggles workspace zooming "
from .interface import Plugin

from ..ipc import hyprctl
from .interface import Plugin


class Extension(Plugin): # pylint: disable=missing-class-docstring
Expand Down
2 changes: 1 addition & 1 deletion pyprland/plugins/monitors.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
" The monitors plugin "
import subprocess
from typing import Any, cast
from .interface import Plugin

from ..ipc import hyprctlJSON
from .interface import Plugin


def configure_monitors(monitors, screenid: str, pos_x: int, pos_y: int) -> None:
Expand Down
10 changes: 3 additions & 7 deletions pyprland/plugins/scratchpads.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
" Scratchpads addon "
import os
import asyncio
import os
import subprocess
from typing import Any, cast

from ..ipc import (
hyprctl,
hyprctlJSON,
get_focused_monitor_props,
)

from ..ipc import get_focused_monitor_props, hyprctl, hyprctlJSON
from .interface import Plugin

DEFAULT_MARGIN = 60
Expand Down Expand Up @@ -230,6 +225,7 @@ async def _alternative_lookup(self):
if not class_lookup_hack:
return False
self.log.debug("Lookup hack triggered")
# hack to update the client info from the provided class
for client in await hyprctlJSON("clients"):
assert isinstance(client, dict)
for pending_scratch in class_lookup_hack:
Expand Down
4 changes: 2 additions & 2 deletions pyprland/plugins/shift_monitors.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
" shift workspaces across monitors "
from typing import cast
from .interface import Plugin

from ..ipc import hyprctlJSON, hyprctl
from ..ipc import hyprctl, hyprctlJSON
from .interface import Plugin


class Extension(Plugin): # pylint: disable=missing-class-docstring
Expand Down
4 changes: 2 additions & 2 deletions pyprland/plugins/toggle_dpms.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
" Toggle monitors on or off "
from typing import Any, cast
from .interface import Plugin

from ..ipc import hyprctlJSON, hyprctl
from ..ipc import hyprctl, hyprctlJSON
from .interface import Plugin


class Extension(Plugin): # pylint: disable=missing-class-docstring
Expand Down
4 changes: 2 additions & 2 deletions pyprland/plugins/workspaces_follow_focus.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
""" Force workspaces to follow the focus / mouse """
from typing import cast
from .interface import Plugin

from ..ipc import hyprctlJSON, hyprctl
from ..ipc import hyprctl, hyprctlJSON
from .interface import Plugin


class Extension(Plugin): # pylint: disable=missing-class-docstring
Expand Down

0 comments on commit 2eafea9

Please sign in to comment.