Skip to content

Commit

Permalink
chore: Add type annotations to truncate method
Browse files Browse the repository at this point in the history
  • Loading branch information
seakrueger committed Sep 2, 2024
1 parent f1db02b commit d180cb7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tagstudio/src/qt/helpers/file_opener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d180cb7

Please sign in to comment.