Skip to content

Commit

Permalink
Fix lint issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Jan 28, 2024
1 parent 3b3130d commit ece15fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions yellowstone/job/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from . import get_user, get_user_avatar, index_site_members
from .get_user import GetUserJob
from .get_user_avatar import GetUserAvatarJob
from .index_forum_threads import ForumThreadsJob
from .index_forum_categories import ForumCategoriesJob
from .index_forum_threads import ForumThreadsJob
from .index_site_members import SiteMemberJob

if TYPE_CHECKING:
Expand Down Expand Up @@ -88,7 +88,7 @@ def index_forum_categories(self, data: ForumCategoriesJob) -> None:
self.add_raw(JobType.INDEX_FORUM_CATEGORIES, cast(Json, data))

def index_forum_threads(self, data: ForumThreadsJob) -> None:
self.add_raw(JobType.INDEX_FORUM_THREADS, cast(Jons, data))
self.add_raw(JobType.INDEX_FORUM_THREADS, cast(Json, data))

def fetch_user(self, data: GetUserJob) -> None:
self.add_raw(JobType.FETCH_USER, cast(Json, data))
Expand Down
8 changes: 5 additions & 3 deletions yellowstone/job/index_forum_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"""

import logging
from typing import TYPE_CHECKING, TypedDict
from typing import TYPE_CHECKING, Optional, TypedDict

from ..request import forum_categories

if TYPE_CHECKING:
from ..core import BackupDispatcher
Expand Down Expand Up @@ -64,13 +66,13 @@ def run(core: "BackupDispatcher", *, data: ForumCategoriesJob) -> None:

if needs_update(progress, category):
core.job.index_forum_threads(
{"site_slug": site_slug, "category_id": category.id}
{"site_slug": site_slug, "category_id": category.id},
)


def needs_update(
last_progress: ForumCategoryProgressRow,
category: ForumCategoryData,
category: forum_categories.ForumCategoryData,
) -> bool:
if category.thread_count > last_progress["thread_count"]:
logger.debug(
Expand Down
11 changes: 9 additions & 2 deletions yellowstone/job/index_forum_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@
as the next page of the list.
"""

from typing import TypedDict
import logging
from typing import TYPE_CHECKING, TypedDict

if TYPE_CHECKING:
from ..core import BackupDispatcher

logger = logging.getLogger(__name__)


class ForumThreadsJob(TypedDict):
pass
site_slug: str
category_id: int


def run(core: "BackupDispatcher", *, data: ForumThreadsJob) -> None:
Expand Down

0 comments on commit ece15fa

Please sign in to comment.