Commit 8dbcae47 authored by Jan Reimes's avatar Jan Reimes
Browse files

refactor: standardize import formatting and organization

parent 9a53ceba
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -13,22 +13,16 @@ import typer
import yaml
from dotenv import load_dotenv
from rich.console import Console
from rich.progress import (BarColumn, MofNCompleteColumn, Progress,
                           SpinnerColumn, TextColumn)
from rich.progress import BarColumn, MofNCompleteColumn, Progress, SpinnerColumn, TextColumn
from rich.table import Table

from tdoc_crawler.crawlers import MeetingCrawler, TDocCrawler
from tdoc_crawler.database import TDocDatabase
from tdoc_crawler.models import (MeetingCrawlConfig, MeetingQueryConfig,
                                 OutputFormat, QueryConfig, SortOrder,
                                 TDocCrawlConfig)
from tdoc_crawler.models import MeetingCrawlConfig, MeetingQueryConfig, OutputFormat, QueryConfig, SortOrder, TDocCrawlConfig

from .fetching import maybe_fetch_missing_tdocs
from .helpers import (build_limits, database_path, launch_file,
                      parse_subgroups, parse_working_groups, prepare_tdoc_file,
                      resolve_credentials)
from .printing import (meeting_to_dict, print_meeting_table, print_tdoc_table,
                       tdoc_to_dict)
from .helpers import build_limits, database_path, launch_file, parse_subgroups, parse_working_groups, prepare_tdoc_file, resolve_credentials
from .printing import meeting_to_dict, print_meeting_table, print_tdoc_table, tdoc_to_dict

load_dotenv()

+2 −6
Original line number Diff line number Diff line
@@ -18,11 +18,9 @@ from urllib.request import urlopen
import typer
from rich.console import Console

from tdoc_crawler.crawlers import (normalize_subgroup_alias,
                                   normalize_working_group_alias)
from tdoc_crawler.crawlers import normalize_subgroup_alias, normalize_working_group_alias
from tdoc_crawler.database import TDocDatabase
from tdoc_crawler.models import (CrawlLimits, PortalCredentials, TDocMetadata,
                                 WorkingGroup)
from tdoc_crawler.models import CrawlLimits, MeetingQueryConfig, PortalCredentials, SortOrder, TDocMetadata, WorkingGroup

console = Console()
_logger = logging.getLogger(__name__)
@@ -214,8 +212,6 @@ def resolve_meeting_id(database: TDocDatabase, meeting_name: str) -> int | None:
    Returns:
        Meeting ID if found, None otherwise
    """
    from tdoc_crawler.models import MeetingQueryConfig, SortOrder

    # Query all meetings from database
    config = MeetingQueryConfig(
        cache_dir=database.db_path.parent,
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ from typing import Any

# No direct imports for any symbols listed in __all__; all are dynamically imported via __getattr__

__all__ = [
__all__ = [  # noqa: F822
    "EXCLUDED_DIRS",
    "EXCLUDED_DIRS_NORMALIZED",
    "MEETING_CODE_REGISTRY",
+1 −1
Original line number Diff line number Diff line
@@ -56,8 +56,8 @@ __all__ = [
    "EXCLUDED_DIRS",
    "EXCLUDED_DIRS_NORMALIZED",
    "LOGIN_URL",
    "MEETING_CODE_REGISTRY",
    "MEETINGS_BASE_URL",
    "MEETING_CODE_REGISTRY",
    "PORTAL_BASE_URL",
    "TDOC_PATTERN",
    "TDOC_PATTERN_STR",
+4 −5
Original line number Diff line number Diff line
@@ -3,12 +3,11 @@
from __future__ import annotations

import asyncio
from collections.abc import Callable, Generator
from collections.abc import Callable
from concurrent.futures import Executor
from contextlib import contextmanager
from typing import Any, TypeVar

from pool_executors import ExecutorType, create_executor
from pool_executors import create_executor

T = TypeVar("T")

@@ -31,7 +30,7 @@ class _RunnerContextManager:
            asyncio.set_event_loop(self.runner._loop)
        return self.runner

    def __exit__(self, exc_type, exc_val, exc_tb) -> None:
    def __exit__(self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: object | None) -> None:
        """Shutdown executor."""
        if self.runner._executor:
            self.runner._executor.shutdown(wait=True)
@@ -88,7 +87,7 @@ class Runner:
        """Context manager entry - not used, use start() instead."""
        return self

    def __exit__(self, exc_type, exc_val, exc_tb) -> None:
    def __exit__(self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: object | None) -> None:
        """Context manager exit - not used, use start() instead."""
        pass

Loading