From 20f93719d79dfb4aadf7736164ece77e34aa2857 Mon Sep 17 00:00:00 2001 From: Jann Stute <46534683+Computerdores@users.noreply.github.com> Date: Thu, 28 Nov 2024 22:19:08 +0100 Subject: [PATCH] fix(ci): surpress errant mypy warnings (#609) * fix: mypy error in ts_qt * fix: mypy error in file_opener due to conflicting types * fix: remove unnecessary type ignores * refix type ignore comments * partially revert "refix type ignore comments" due to being implemented in #608 --- tagstudio/src/qt/helpers/file_opener.py | 4 ++-- tagstudio/src/qt/ts_qt.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tagstudio/src/qt/helpers/file_opener.py b/tagstudio/src/qt/helpers/file_opener.py index 0f4a7e0a..0672ed84 100644 --- a/tagstudio/src/qt/helpers/file_opener.py +++ b/tagstudio/src/qt/helpers/file_opener.py @@ -34,11 +34,11 @@ def open_file(path: str | Path, file_manager: bool = False): normpath = Path(path).resolve().as_posix() if file_manager: command_name = "explorer" - command_args = '/select,"' + normpath + '"' + command_arg = '/select,"' + normpath + '"' # For some reason, if the args are passed in a list, this will error when the # path has spaces, even while surrounded in double quotes. subprocess.Popen( - command_name + command_args, + command_name + command_arg, shell=True, close_fds=True, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP diff --git a/tagstudio/src/qt/ts_qt.py b/tagstudio/src/qt/ts_qt.py index c7dfa99c..f934892a 100644 --- a/tagstudio/src/qt/ts_qt.py +++ b/tagstudio/src/qt/ts_qt.py @@ -254,7 +254,7 @@ class QtDriver(DriverMixin, QObject): if os.name == "nt": appid = "cyanvoxel.tagstudio.9" - ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appid) # type: ignore + ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appid) # type: ignore[attr-defined,unused-ignore] if sys.platform != "darwin": icon = QIcon() @@ -823,6 +823,7 @@ class QtDriver(DriverMixin, QObject): if field.type.type == FieldTypeEnum.TEXT_LINE and field.value: self.lib.update_entry_field( entry_ids=entry.id, + field=field, content=strip_web_protocol(field.value), )