Merge commit '1c999be8c8134fe01a75723ea933858435856950'

# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.md
#	launch.py
#	modules/async_worker.py
#	modules/config.py
#	modules/private_logger.py
#	modules/util.py
#	webui.py
This commit is contained in:
Manuel Schmid
2024-02-12 21:13:36 +01:00
15 changed files with 49 additions and 33 deletions
+4 -1
View File
@@ -179,7 +179,7 @@ def get_files_from_folder(folder_path, exensions=None, name_filter=None):
path = os.path.join(relative_path, filename)
filenames.append(path)
return sorted(filenames, key=lambda x: -1 if os.sep in x else 1)
return filenames
def calculate_sha256(filename, length=HASH_SHA256_LENGTH) -> str:
@@ -340,3 +340,6 @@ def is_json(data: str) -> bool:
except (ValueError, AssertionError):
return False
return True
def ordinal_suffix(number: int) -> str:
return 'th' if 10 <= number % 100 <= 20 else {1: 'st', 2: 'nd', 3: 'rd'}.get(number % 10, 'th')