mirror of
https://github.com/harry0703/MoneyPrinterTurbo.git
synced 2026-02-21 08:27:22 +08:00
feat: improve file extension parsing using pathlib
This commit is contained in:
parent
a601705bf4
commit
97c631e696
@ -1,6 +1,7 @@
|
||||
import json
|
||||
import locale
|
||||
import os
|
||||
from pathlib import Path
|
||||
import threading
|
||||
from typing import Any
|
||||
from uuid import uuid4
|
||||
@ -226,4 +227,4 @@ def load_locales(i18n_dir):
|
||||
|
||||
|
||||
def parse_extension(filename):
|
||||
return os.path.splitext(filename)[1].strip().lower().replace(".", "")
|
||||
return Path(filename).suffix.lower().lstrip('.')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user