From dd4d217f86cf4055df04c3f3eb50c20be1651497 Mon Sep 17 00:00:00 2001 From: Harlan Lieberman-Berg Date: Sun, 15 Mar 2026 18:54:50 -0400 Subject: [PATCH] Sort import blocks This was done via ruff --select I --fix. --- efiction/chapters.py | 8 ++++---- efiction/metadata.py | 12 ++++++------ efiction/original.py | 8 ++++---- efiction/simplified.py | 2 +- efiction/tag_converter.py | 1 - efiction/tests/test_chapters.py | 4 ++-- efiction/tests/test_metadata.py | 2 +- opendoors/big_insert.py | 5 +++-- opendoors/logging.py | 2 +- opendoors/step_base.py | 2 +- opendoors/tests/test_progress.py | 4 ++-- opendoors/tests/test_utils.py | 2 +- opendoors/utils.py | 5 ++--- start.py | 1 - 14 files changed, 28 insertions(+), 30 deletions(-) diff --git a/efiction/chapters.py b/efiction/chapters.py index 79c87a4..3a70c5f 100644 --- a/efiction/chapters.py +++ b/efiction/chapters.py @@ -5,15 +5,15 @@ from pathlib import Path from typing import List -from opendoors.mysql import SqlDb from opendoors.big_insert import BigInsert +from opendoors.mysql import SqlDb from opendoors.utils import ( get_full_path, + get_prefixed_path, + key_find, + make_banner, normalize, print_progress, - make_banner, - key_find, - get_prefixed_path, ) diff --git a/efiction/metadata.py b/efiction/metadata.py index 98435a5..af9f935 100644 --- a/efiction/metadata.py +++ b/efiction/metadata.py @@ -5,21 +5,21 @@ from unidecode import unidecode from efiction.tag_converter import TagConverter +from opendoors.big_insert import BigInsert from opendoors.mysql import SqlDb from opendoors.sql_utils import ( + add_create_database, parse_remove_comments, write_statements_to_file, - add_create_database, ) +from opendoors.thread_pool import ThreadedPool from opendoors.utils import ( - print_progress, get_full_path, - normalize, - key_find, get_prefixed_path, + key_find, + normalize, + print_progress, ) -from opendoors.thread_pool import ThreadedPool -from opendoors.big_insert import BigInsert class EFictionMetadata: diff --git a/efiction/original.py b/efiction/original.py index 8ae56bc..499db31 100644 --- a/efiction/original.py +++ b/efiction/original.py @@ -7,14 +7,14 @@ from efiction.eFiction_table_defs import create_def from opendoors.mysql import SqlDb from opendoors.sql_utils import ( - write_statements_to_file, - parse_remove_comments, - group_by_table, add_create_database, + group_by_table, + parse_remove_comments, + write_statements_to_file, ) from opendoors.utils import ( - copy_to_dir, check_if_file_exists, + copy_to_dir, get_full_path, get_prefixed_path, ) diff --git a/efiction/simplified.py b/efiction/simplified.py index 6c14de0..f82c502 100644 --- a/efiction/simplified.py +++ b/efiction/simplified.py @@ -4,8 +4,8 @@ from opendoors.mysql import SqlDb from opendoors.sql_utils import ( - group_by_table, add_create_database, + group_by_table, parse_remove_comments, write_statements_to_file, ) diff --git a/efiction/tag_converter.py b/efiction/tag_converter.py index fc078a9..b6079d9 100644 --- a/efiction/tag_converter.py +++ b/efiction/tag_converter.py @@ -1,6 +1,5 @@ from configparser import ConfigParser from logging import Logger - from typing import Dict, List from opendoors.mysql import SqlDb diff --git a/efiction/tests/test_chapters.py b/efiction/tests/test_chapters.py index 16bfd20..76f567c 100644 --- a/efiction/tests/test_chapters.py +++ b/efiction/tests/test_chapters.py @@ -1,8 +1,8 @@ -import json import copy +import json from unittest.mock import MagicMock, patch -import pytest +import pytest from efiction.chapters import EFictionChapters from opendoors.config import ArchiveConfig diff --git a/efiction/tests/test_metadata.py b/efiction/tests/test_metadata.py index 13a2dab..ec54264 100644 --- a/efiction/tests/test_metadata.py +++ b/efiction/tests/test_metadata.py @@ -1,7 +1,7 @@ import datetime from unittest import TestCase -from efiction.tests.test_utils import load_fixtures, create_efiction_converter +from efiction.tests.test_utils import create_efiction_converter, load_fixtures from opendoors.utils import remove_output_files diff --git a/opendoors/big_insert.py b/opendoors/big_insert.py index 9fb92fb..84e9f61 100644 --- a/opendoors/big_insert.py +++ b/opendoors/big_insert.py @@ -1,6 +1,7 @@ -from .mysql import SqlDb -from tempfile import NamedTemporaryFile from os import unlink +from tempfile import NamedTemporaryFile + +from .mysql import SqlDb class BigInsert: diff --git a/opendoors/logging.py b/opendoors/logging.py index cc0b917..b60467a 100644 --- a/opendoors/logging.py +++ b/opendoors/logging.py @@ -3,8 +3,8 @@ """ import logging import os - import sys + from colorlog import ColoredFormatter diff --git a/opendoors/step_base.py b/opendoors/step_base.py index 5f91d39..60952e8 100644 --- a/opendoors/step_base.py +++ b/opendoors/step_base.py @@ -6,7 +6,7 @@ from logging import Logger from opendoors.mysql import SqlDb -from opendoors.utils import make_banner, get_prefixed_path +from opendoors.utils import get_prefixed_path, make_banner @dataclass diff --git a/opendoors/tests/test_progress.py b/opendoors/tests/test_progress.py index eb15743..a202cd4 100644 --- a/opendoors/tests/test_progress.py +++ b/opendoors/tests/test_progress.py @@ -1,8 +1,8 @@ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from opendoors.config import ArchiveConfig -from opendoors.progress import continue_from_last, update_done_steps, get_next_step +from opendoors.progress import continue_from_last, get_next_step, update_done_steps from opendoors.step_base import StepBase, StepInfo from opendoors.utils import remove_output_files diff --git a/opendoors/tests/test_utils.py b/opendoors/tests/test_utils.py index 7fa5691..ffd31b7 100644 --- a/opendoors/tests/test_utils.py +++ b/opendoors/tests/test_utils.py @@ -2,7 +2,7 @@ from unittest import TestCase from unittest.mock import patch -from opendoors.utils import make_banner, set_working_dir, get_prefixed_path +from opendoors.utils import get_prefixed_path, make_banner, set_working_dir class UtilsTest(TestCase): diff --git a/opendoors/utils.py b/opendoors/utils.py index ac198b0..3bc878c 100644 --- a/opendoors/utils.py +++ b/opendoors/utils.py @@ -6,10 +6,9 @@ import os import re import shutil -from typing import Mapping -from pathlib import Path - import unicodedata +from pathlib import Path +from typing import Mapping def get_full_path(path): diff --git a/start.py b/start.py index 8b9c8c4..073542b 100755 --- a/start.py +++ b/start.py @@ -1,7 +1,6 @@ #!/usr/bin/python3 import atexit import configparser - import sys from opendoors import progress