From 34b628dd22e9d92678f2a398d1fe6745636f11d4 Mon Sep 17 00:00:00 2001 From: Kalmat Date: Tue, 26 Mar 2024 08:11:31 +0100 Subject: [PATCH] v0.7 pre-release --- README.md | 4 ++-- src/pywinctl/_pywinctl_macos.py | 5 ++--- src/pywinctl/_pywinctl_win.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0a9e00a..a8ce21d 100644 --- a/README.md +++ b/README.md @@ -251,9 +251,9 @@ or python3 -m pip install pywinctl -Alternatively, you can download the wheel file (.whl) available in the [Download page](https://pypi.org/project/PyWinCtl/#files) and the [dist folder](https://github.com/Kalmat/PyWinCtl/tree/master/dist), and run this (don't forget to replace 'x.x.xx' with proper version number): +Alternatively, you can download the wheel file (.whl) available in the [Download page](https://pypi.org/project/PyWinCtl/#files) and run this (don't forget to replace 'x.xx' with proper version number): - pip install PyWinCtl-x.x.xx-py3-none-any.whl + pip install PyWinCtl-x.xx-py3-none-any.whl You may want to add `--force-reinstall` option to be sure you are installing the right dependencies version. diff --git a/src/pywinctl/_pywinctl_macos.py b/src/pywinctl/_pywinctl_macos.py index 95819bc..e708c1a 100644 --- a/src/pywinctl/_pywinctl_macos.py +++ b/src/pywinctl/_pywinctl_macos.py @@ -507,7 +507,7 @@ def __init__(self, app: AppKit.NSRunningApplication, title: str): self._appName: str = self.getProcName(self._appPID) if not self._appName: # localizedName() is not recognized in AppleScript for non-English languages - self._appName: str = app.localizedName() + self._appName = app.localizedName() self._initTitle: str = title self._winTitle: str = title # self._parent = self.getParent() # It is slow and not required by now @@ -1301,8 +1301,7 @@ def visible(self) -> bool: :return: ``True`` if the window is currently visible """ - return self._winTitle and self._winTitle in _getAppWindowsTitles(self._app) - + return bool(self._winTitle and self._winTitle in _getAppWindowsTitles(self._app)) isVisible: bool = cast(bool, visible) # isVisible is an alias for the visible property. @property diff --git a/src/pywinctl/_pywinctl_win.py b/src/pywinctl/_pywinctl_win.py index c120abb..a3cc92f 100644 --- a/src/pywinctl/_pywinctl_win.py +++ b/src/pywinctl/_pywinctl_win.py @@ -823,7 +823,7 @@ def isParent(self, child: int) -> bool: :param child: handle of the window you want to check if the current window is parent of :return: ''True'' if current window is parent of the given window """ - return child and win32gui.GetParent(child) == self._hWnd + return bool(child and win32gui.GetParent(child) == self._hWnd) isParentOf = isParent # isParentOf is an alias of isParent method def isChild(self, parent: int) -> bool: