diff --git a/libqfieldsync/utils/file_utils.py b/libqfieldsync/utils/file_utils.py index 70658e8..e50fd2b 100644 --- a/libqfieldsync/utils/file_utils.py +++ b/libqfieldsync/utils/file_utils.py @@ -191,6 +191,7 @@ def isascii(filename: str) -> bool: except UnicodeEncodeError: return False + def is_valid_filename(filename: str) -> bool: """ Check if the filename is valid. @@ -201,8 +202,10 @@ def is_valid_filename(filename: str) -> bool: r'[^\\\/:*"?<>|]{1,254}' r"(? bool: """ Check if the entire path is valid by validating each part of the path. @@ -211,4 +214,5 @@ def is_valid_filepath(path: str) -> bool: for part in path_obj.parts: if not is_valid_filename(part): return False - return True \ No newline at end of file + + return True