Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace use of os.path with pathlib #156

Merged
merged 43 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3db106a
Replace usage of os.path with usage of pathlib.Path in ts_cli.py
Icosahunter Apr 28, 2024
6b2fec0
Replace use of os.path with pathlib in Library.py
Icosahunter May 5, 2024
55bc40e
Replace use of os.path with pathlib in ts_core.py
Icosahunter May 5, 2024
e307c0c
resolve entry path/filename on creation/update
Icosahunter May 5, 2024
7bc5158
Fix errors and bugs related to move from os.path to pathlib.
Icosahunter May 6, 2024
cf959df
Remove most uses of '.resolve()' as it didn't do what I thought it did
Icosahunter May 8, 2024
6dd7309
Fix filtering in refresh directories to not need to cast to string.
Icosahunter May 8, 2024
b33beeb
Some work on ts_qt, thumbnails don't load...
Icosahunter May 8, 2024
7834b98
Fixed the thumbnail issue, things seem to be working.
Icosahunter May 10, 2024
f6fa868
Fix some bugs
Icosahunter May 10, 2024
6406940
Merge branch 'main' into main
Icosahunter May 10, 2024
fb2620a
Replace some isfile with is_file ts_cli.py
Icosahunter May 10, 2024
e8f8d72
Update tagstudio/src/core/library.py
Icosahunter May 10, 2024
c7ea8af
Update library.py
Icosahunter May 10, 2024
d5d286c
Update library.py
Icosahunter May 10, 2024
7d41888
Update library.py
Icosahunter May 10, 2024
eaa1185
Update ts_cli.py
Icosahunter May 10, 2024
0ed7498
Update library.py
Icosahunter May 10, 2024
9c03405
Update ts_qt
Icosahunter May 12, 2024
26a67e5
Merge branch 'main' into main
Icosahunter May 12, 2024
967c2c9
Fix path display in delete unlinked entries modal
Icosahunter May 12, 2024
d9e616c
Ruff formatting
Icosahunter May 12, 2024
7c57193
Merge branch 'main' into main
Icosahunter May 16, 2024
074e96f
Builds and opens/creates library now
Icosahunter May 16, 2024
34e76d8
Fix errors
Icosahunter May 17, 2024
0641eb4
Merge branch 'main' into main
Icosahunter May 17, 2024
3e5bba3
Fix ruff and mypy issues (hopefully)
Icosahunter May 19, 2024
cbb38ed
Merge branch 'main' into main
Icosahunter May 19, 2024
e02b803
Fixed some things, broke some things
Icosahunter May 19, 2024
b1cd39e
Fixed the thumbnails not working
Icosahunter May 19, 2024
a53b515
Fix some new os.path instances in qt files
Icosahunter May 23, 2024
e5a12b9
Fix MyPy issues
Icosahunter May 23, 2024
277fc15
Fix ruff and mypy issues
Icosahunter May 23, 2024
b755513
Fix some issues
Icosahunter May 23, 2024
f71136f
Update tagstudio/src/qt/widgets/preview_panel.py
Icosahunter May 26, 2024
adb90f9
Update tagstudio/src/qt/widgets/preview_panel.py
Icosahunter May 26, 2024
bb8fb0b
Update tagstudio/src/qt/widgets/preview_panel.py
Icosahunter May 26, 2024
213910e
Update tagstudio/src/qt/widgets/preview_panel.py
Icosahunter May 26, 2024
dc2f7fb
Update tagstudio/src/qt/widgets/thumb_renderer.py
Icosahunter May 26, 2024
a69914d
Update tagstudio/src/qt/widgets/thumb_renderer.py
Icosahunter May 26, 2024
ecf71e9
Fix refresh_dupe_files issue
Icosahunter May 26, 2024
638abcc
Ruff format
Icosahunter May 26, 2024
e3831e7
Tweak filepaths
CyanVoxel May 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
141 changes: 61 additions & 80 deletions tagstudio/src/cli/ts_cli.py

Large diffs are not rendered by default.

136 changes: 73 additions & 63 deletions tagstudio/src/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,76 +9,86 @@

# TODO: Turn this whitelist into a user-configurable blacklist.
IMAGE_TYPES: list[str] = [
"png",
"jpg",
"jpeg",
"jpg_large",
"jpeg_large",
"jfif",
"gif",
"tif",
"tiff",
"heic",
"heif",
"webp",
"bmp",
"svg",
"avif",
"apng",
"jp2",
"j2k",
"jpg2",
".png",
".jpg",
".jpeg",
".jpg_large",
".jpeg_large",
".jfif",
".gif",
".tif",
".tiff",
".heic",
".heif",
".webp",
".bmp",
".svg",
".avif",
".apng",
".jp2",
".j2k",
".jpg2",
]
RAW_IMAGE_TYPES: list[str] = ["raw", "dng", "rw2", "nef", "arw", "crw", "cr3"]
RAW_IMAGE_TYPES: list[str] = [".raw", ".dng", ".rw2", ".nef", ".arw", ".crw", ".cr3"]
VIDEO_TYPES: list[str] = [
"mp4",
"webm",
"mov",
"hevc",
"mkv",
"avi",
"wmv",
"flv",
"gifv",
"m4p",
"m4v",
"3gp",
".mp4",
".webm",
".mov",
".hevc",
".mkv",
".avi",
".wmv",
".flv",
".gifv",
".m4p",
".m4v",
".3gp",
]
AUDIO_TYPES: list[str] = [
"mp3",
"mp4",
"mpeg4",
"m4a",
"aac",
"wav",
"flac",
"alac",
"wma",
"ogg",
"aiff",
".mp3",
".mp4",
".mpeg4",
".m4a",
".aac",
".wav",
".flac",
".alac",
".wma",
".ogg",
".aiff",
]
DOC_TYPES: list[str] = [
".txt",
".rtf",
".md",
".doc",
".docx",
".pdf",
".tex",
".odt",
".pages",
]
DOC_TYPES: list[str] = ["txt", "rtf", "md", "doc", "docx", "pdf", "tex", "odt", "pages"]
PLAINTEXT_TYPES: list[str] = [
"txt",
"md",
"css",
"html",
"xml",
"json",
"js",
"ts",
"ini",
"htm",
"csv",
"php",
"sh",
"bat",
".txt",
".md",
".css",
".html",
".xml",
".json",
".js",
".ts",
".ini",
".htm",
".csv",
".php",
".sh",
".bat",
]
SPREADSHEET_TYPES: list[str] = ["csv", "xls", "xlsx", "numbers", "ods"]
PRESENTATION_TYPES: list[str] = ["ppt", "pptx", "key", "odp"]
ARCHIVE_TYPES: list[str] = ["zip", "rar", "tar", "tar.gz", "tgz", "7z"]
PROGRAM_TYPES: list[str] = ["exe", "app"]
SHORTCUT_TYPES: list[str] = ["lnk", "desktop", "url"]
SPREADSHEET_TYPES: list[str] = [".csv", ".xls", ".xlsx", ".numbers", ".ods"]
PRESENTATION_TYPES: list[str] = [".ppt", ".pptx", ".key", ".odp"]
ARCHIVE_TYPES: list[str] = [".zip", ".rar", ".tar", ".tar", ".gz", ".tgz", ".7z"]
PROGRAM_TYPES: list[str] = [".exe", ".app"]
SHORTCUT_TYPES: list[str] = [".lnk", ".desktop", ".url"]

ALL_FILE_TYPES: list[str] = (
IMAGE_TYPES
Expand Down