Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pytest = [
"pytest-qt==4.4.0",
"syrupy==5.1.0",
]
ruff = ["ruff==0.11.8"]
ruff = ["ruff==0.15.17"]

[project.gui-scripts]
tagstudio = "tagstudio.main:main"
Expand Down
10 changes: 5 additions & 5 deletions src/tagstudio/core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import enum


class SettingItems(str, enum.Enum):
class SettingItems(enum.StrEnum):
"""List of setting item names."""

LAST_LIBRARY = "last_library"
LIBS_LIST = "libs_list"


class ShowFilepathOption(int, enum.Enum):
class ShowFilepathOption(enum.IntEnum):
"""Values representing the options for the "show_filenames" setting."""

SHOW_FULL_PATHS = 0
Expand All @@ -21,7 +21,7 @@ class ShowFilepathOption(int, enum.Enum):
DEFAULT = SHOW_RELATIVE_PATHS


class TagClickActionOption(int, enum.Enum):
class TagClickActionOption(enum.IntEnum):
"""Values representing the options for the "tag_click_action" setting."""

OPEN_EDIT = 0
Expand All @@ -30,7 +30,7 @@ class TagClickActionOption(int, enum.Enum):
DEFAULT = OPEN_EDIT


class Theme(str, enum.Enum):
class Theme(enum.StrEnum):
COLOR_BG_DARK = "#65000000"
COLOR_BG_LIGHT = "#22000000"
COLOR_DARK_LABEL = "#DD000000"
Expand All @@ -49,7 +49,7 @@ class OpenStatus(enum.IntEnum):
CORRUPTED = 2


class MacroID(enum.Enum):
class MacroID(enum.StrEnum):
AUTOFILL = "autofill"
SIDECAR = "sidecar"
BUILD_URL = "build_url"
Expand Down
4 changes: 2 additions & 2 deletions src/tagstudio/core/media_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# SPDX-License-Identifier: GPL-3.0-only


import enum
import mimetypes
from dataclasses import dataclass
from enum import Enum
from pathlib import Path

import structlog
Expand All @@ -23,7 +23,7 @@
]


class MediaType(str, Enum):
class MediaType(enum.StrEnum):
"""Names of media types."""

ADOBE_PHOTOSHOP = "adobe_photoshop"
Expand Down
2 changes: 1 addition & 1 deletion src/tagstudio/core/query_lang/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def from_string(text: str) -> "ConstraintType | None":
"filetype": ConstraintType.FileType,
"path": ConstraintType.Path,
"special": ConstraintType.Special,
}.get(text.lower(), None)
}.get(text.lower())


class AST:
Expand Down
7 changes: 1 addition & 6 deletions src/tagstudio/core/utils/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-only


from typing import TypeVar

T = TypeVar("T")


def unwrap(optional: T | None, default: T | None = None) -> T:
def unwrap[T](optional: T | None, default: T | None = None) -> T:
if optional is not None:
return optional
if default is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/tagstudio/qt/mixed/field_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def write_tag_container(
inner_widget.set_tags(tags)

inner_widget.on_update.connect(
lambda: (self.update_from_entry(self.cached_entries[0].id, update_badges=True))
lambda: self.update_from_entry(self.cached_entries[0].id, update_badges=True)
)
else:
text = "<i>Mixed Data</i>"
Expand Down
4 changes: 2 additions & 2 deletions src/tagstudio/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ def start(self) -> None:
self.tag_manager_panel = PanelModal(
widget=TagDatabasePanel(self, self.lib),
title=Translations["tag_manager.title"],
done_callback=lambda checked=False: (
self.main_window.preview_panel.set_selection(self.selected, update_preview=False)
done_callback=lambda checked=False: self.main_window.preview_panel.set_selection(
self.selected, update_preview=False
),
has_save=False,
)
Expand Down
Loading