Skip to content

Commit 3ee543b

Browse files
committed
refactor: remove dunder naming
1 parent b24900b commit 3ee543b

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/tagstudio/core/library/alchemy/library.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ def open_sqlite_library(
621621
self.library_dir = library_dir
622622
return LibraryStatus(success=True, library_path=library_dir)
623623

624-
def __apply_db7_migration(self, session: Session, __library_dir__: Path):
624+
def __apply_db7_migration(self, session: Session, _library_dir: Path):
625625
"""Migrate DB from DB_VERSION 6 to 7."""
626626
logger.info("[Library][Migration][7] Applying patches to DB_VERSION: 6 library...")
627627
# Repair tags that may have a disambiguation_id pointing towards a deleted tag.
@@ -635,7 +635,7 @@ def __apply_db7_migration(self, session: Session, __library_dir__: Path):
635635
session.execute(disam_stmt)
636636
session.flush()
637637

638-
def __apply_db8_migration(self, session: Session, __library_dir__: Path):
638+
def __apply_db8_migration(self, session: Session, library_dir: Path):
639639
"""Migrate DB from DB_VERSION 7 to 8."""
640640
# Add the missing color_border column to the TagColorGroups table.
641641
session.execute(
@@ -682,7 +682,7 @@ def __apply_db8_migration(self, session: Session, __library_dir__: Path):
682682
session.execute(neon_stmt)
683683
session.flush()
684684

685-
def __apply_db9_migration(self, session: Session, __library_dir__: Path):
685+
def __apply_db9_migration(self, session: Session, library_dir: Path):
686686
"""Migrate DB from DB_VERSION 8 to 9."""
687687
# Apply database schema changes
688688
add_filename_column = text(
@@ -699,7 +699,7 @@ def __apply_db9_migration(self, session: Session, __library_dir__: Path):
699699
session.flush()
700700
logger.info("[Library][Migration][9] Populated filename column in entries table")
701701

702-
def __apply_db100_migration(self, session: Session, __library_dir__: Path):
702+
def __apply_db100_migration(self, session: Session, library_dir: Path):
703703
"""Migrate DB to DB_VERSION 100."""
704704
# Repair parent-child tag relationships that are the wrong way around.
705705
stmt = update(TagParent).values(
@@ -710,21 +710,21 @@ def __apply_db100_migration(self, session: Session, __library_dir__: Path):
710710
session.flush()
711711
logger.info("[Library][Migration][100] Refactored TagParent table")
712712

713-
def __apply_db101_migration(self, session: Session, __library_dir__: Path):
713+
def __apply_db101_migration(self, session: Session, library_dir: Path):
714714
"""Migrate DB to DB_VERSION 101."""
715715
# Ensure version rows are present
716716
session.add(Version(key=DB_VERSION_INITIAL_KEY, value=100))
717717
session.flush()
718718

719-
def __apply_db102_migration(self, session: Session, __library_dir__: Path):
719+
def __apply_db102_migration(self, session: Session, library_dir: Path):
720720
"""Migrate DB to DB_VERSION 102."""
721721
# delete TagParents with a dangling parent reference
722722
stmt = delete(TagParent).where(TagParent.parent_id.not_in(select(Tag.id).distinct()))
723723
session.execute(stmt)
724724
session.flush()
725725
logger.info("[Library][Migration][102] Verified TagParent table data")
726726

727-
def __apply_db103_migration(self, session: Session, __library_dir__: Path):
727+
def __apply_db103_migration(self, session: Session, library_dir: Path):
728728
"""Migrate DB from DB_VERSION 102 to 103."""
729729
# add the new hidden column for tags
730730
session.execute(text("ALTER TABLE tags ADD COLUMN is_hidden BOOLEAN NOT NULL DEFAULT 0"))
@@ -762,7 +762,7 @@ def __migrate_sql_to_ts_ignore(self, session: Session, library_dir: Path):
762762
with open(ts_ignore, "w") as f:
763763
f.write(migrate_ext_list(extensions, is_exclude_list))
764764

765-
def __apply_db200_migration(self, session: Session, __library_dir__: Path):
765+
def __apply_db200_migration(self, session: Session, library_dir: Path):
766766
"""Migrate DB to DB_VERSION 200."""
767767
# Drop unused 'boolean_fields' and 'value_type' tables
768768
logger.info("[Library][Migration][200] Dropping boolean_fields and value_type tables...")
@@ -849,7 +849,7 @@ def __apply_db200_migration(self, session: Session, __library_dir__: Path):
849849
text("CREATE INDEX IF NOT EXISTS idx_tag_entries_entry_id ON tag_entries (entry_id)")
850850
)
851851

852-
def __apply_db201_migration(self, session: Session, __library_dir__: Path):
852+
def __apply_db201_migration(self, session: Session, library_dir: Path):
853853
"""Migrate DB to DB_VERSION 201."""
854854
create_text_fields_table = text("""
855855
CREATE TABLE text_fields_new (
@@ -899,7 +899,7 @@ def __apply_db201_migration(self, session: Session, __library_dir__: Path):
899899

900900
session.flush()
901901

902-
def __apply_db202_migration(self, session: Session, __library_dir__: Path):
902+
def __apply_db202_migration(self, session: Session, library_dir: Path):
903903
"""Migrate DB to DB_VERSION 202."""
904904
stmt = delete(TagParent).where(TagParent.child_id.not_in(select(Tag.id).distinct()))
905905
session.execute(stmt)

0 commit comments

Comments
 (0)