From 295014b3c2d79d6bf0deba199ede0c787b1eab68 Mon Sep 17 00:00:00 2001 From: fdev31 Date: Fri, 19 Apr 2024 19:18:47 +0200 Subject: [PATCH] Version 2.2.9 --- pyprland/command.py | 2 +- pyprland/common.py | 7 ++++--- pyprland/plugins/pyprland.py | 6 ++++-- pyproject.toml | 2 +- tests/conftest.py | 11 +++++++++++ 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pyprland/command.py b/pyprland/command.py index 0e7f55b..0e4c0f3 100755 --- a/pyprland/command.py +++ b/pyprland/command.py @@ -401,7 +401,7 @@ async def run_client(): manager = Pyprland() if sys.argv[1] == "version": - print("2.2.8-12") # Automatically updated version + print("2.2.9") # Automatically updated version return if sys.argv[1] == "edit": diff --git a/pyprland/common.py b/pyprland/common.py index ae886c8..670f731 100644 --- a/pyprland/common.py +++ b/pyprland/common.py @@ -184,9 +184,10 @@ def get_logger(name="pypr", level=None) -> logging.Logger: @dataclass(order=True) class VersionInfo: - major: int = 0 - minor: int = 0 - micro: int = 0 + "Stores version information" + major: int = 0 # noqa: F841 + minor: int = 0 # noqa: F841 + micro: int = 0 # noqa: F841 @dataclass diff --git a/pyprland/plugins/pyprland.py b/pyprland/plugins/pyprland.py index 39a3a62..8c19e11 100644 --- a/pyprland/plugins/pyprland.py +++ b/pyprland/plugins/pyprland.py @@ -14,8 +14,10 @@ async def init(self): state.hyprland_version = VersionInfo( *(int(i) for i in version[1:].split(".")[:3]) ) - except Exception: - self.log.error("Fail to parse hyprctl version.") + except Exception as e: # pylint: disable=broad-except + self.log.error("Fail to parse hyprctl version: %s", e) + await self.notify_error("Fail to parse hyprctl version") + state.hyprland_version = VersionInfo(0, 0, 0) state.active_workspace = (await self.hyprctlJSON("activeworkspace"))["name"] monitors = await self.hyprctlJSON("monitors") diff --git a/pyproject.toml b/pyproject.toml index 3241fd1..ba6fbe8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyprland" -version = "2.2.8" +version = "2.2.9" description = "Hyperland plugin system - batteries included" authors = ["fdev31 "] license = "MIT" diff --git a/tests/conftest.py b/tests/conftest.py index c5ed4c2..7507455 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -94,6 +94,17 @@ async def mocked_hyprctlJSON(command, logger=None): return deepcopy(MONITORS) if command == "activeworkspace": return {"name": "1", "id": 1} + if command == "version": + return { + "branch": "", + "commit": "fe7b748eb668136dd0558b7c8279bfcd7ab4d759", + "dirty": False, + "commit_message": "props: bump version to 0.39.1", + "commit_date": "Tue Apr 16 16:01:03 2024", + "tag": "v0.39.1", + "commits": 4460, + "flags": [], + } raise NotImplementedError()