From d180cb7c8e5235ba4c96ca999cb6ed8b185a8ec4 Mon Sep 17 00:00:00 2001 From: Sean Krueger Date: Mon, 2 Sep 2024 07:43:56 -0500 Subject: [PATCH] chore: Add type annotations to truncate method --- tagstudio/src/qt/helpers/file_opener.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tagstudio/src/qt/helpers/file_opener.py b/tagstudio/src/qt/helpers/file_opener.py index 2bfb1af34..f5f42dbeb 100644 --- a/tagstudio/src/qt/helpers/file_opener.py +++ b/tagstudio/src/qt/helpers/file_opener.py @@ -139,8 +139,12 @@ def setFilePath(self, filepath): """ self.filepath = filepath - def truncate_single_filepath(self, filepath): - """Removes parent directories to fit path to a single line""" + def truncate_single_filepath(self, filepath: Path | str): + """Removes parent directories to fit path to a single line + + Args: + filepath (Path | str): The path to the file to open. + """ path = Path(filepath) parts = path.parts # Since font is not monospace, max chars comes out a little low since average is larger than most ASCII chars