Skip to content

Commit

Permalink
fix: type hint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanVoxel committed Dec 23, 2024
1 parent e317509 commit 1be7e49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions tagstudio/src/core/library/alchemy/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,9 +871,9 @@ def tag_from_strings(self, strings: list[str] | str) -> list[int]:
def add_tag(
self,
tag: Tag,
subtag_ids: set[int] | None = None,
alias_names: set[str] | None = None,
alias_ids: set[int] | None = None,
subtag_ids: list[int] | set[int] | None = None,
alias_names: list[int] | set[str] | None = None,
alias_ids: list[int] | set[int] | None = None,
) -> Tag | None:
with Session(self.engine, expire_on_commit=False) as session:
try:
Expand Down Expand Up @@ -1048,9 +1048,9 @@ def remove_subtag(self, base_id: int, remove_tag_id: int) -> bool:
def update_tag(
self,
tag: Tag,
subtag_ids: set[int] | None = None,
alias_names: set[str] | None = None,
alias_ids: set[int] | None = None,
subtag_ids: list[int] | set[int] | None = None,
alias_names: list[int] | set[str] | None = None,
alias_ids: list[int] | set[int] | None = None,
) -> None:
"""Edit a Tag in the Library."""
self.add_tag(tag, subtag_ids, alias_names, alias_ids)
Expand Down
10 changes: 4 additions & 6 deletions tagstudio/src/qt/modals/build_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ def __init__(self, library: Library, tag: Tag | None = None):
self.root_layout.addWidget(self.subtags_widget)
self.root_layout.addWidget(self.color_widget)

self.subtag_ids: list[int] = list()
self.alias_ids: list[int] = list()
self.alias_names: list[str] = list()
self.new_alias_names: dict = dict()
self.subtag_ids: list[int] = []
self.alias_ids: list[int] = []
self.alias_names: list[str] = []
self.new_alias_names: dict = {}
self.new_item_id = sys.maxsize

self.set_tag(tag or Tag(name="New Tag"))
Expand Down Expand Up @@ -346,8 +346,6 @@ def _alias_name_change(self, item: CustomTableItem):
def set_tag(self, tag: Tag):
self.tag = tag

self.tag = tag

logger.info("setting tag", tag=tag)

self.name_field.setText(tag.name)
Expand Down

0 comments on commit 1be7e49

Please sign in to comment.