Copy changes from download_dicts branch

This commit is contained in:
Veronica Berglyd Olsen
2023-11-20 17:24:49 +01:00
parent c585c87633
commit e00e64dc46
10 changed files with 176 additions and 18 deletions
+8
View File
@@ -487,6 +487,14 @@ def makeFileNameSafe(text: str) -> str:
return "".join(c for c in text if c.isalnum() or c in allowed)
def getFileSize(path: Path) -> int:
"""Return the size of a file."""
try:
return path.stat().st_size
except Exception:
return -1
# =============================================================================================== #
# Other Functions
# =============================================================================================== #