Skip to content

Commit

Permalink
Move ForumUserData type.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Feb 8, 2024
1 parent e1c8a7e commit 965a23a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 1 addition & 7 deletions yellowstone/request/forum_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ..request.site_members import USER_ID_REGEX
from ..request.user import USER_SLUG_REGEX
from ..scraper import find_element, get_entity_date, make_soup, regex_extract
from ..types import ForumUserData
from ..wikidot import Wikidot

CATEGORY_ID_REGEX = re.compile(r"\/forum\/c-(\d+)(?:\/.+)?")
Expand All @@ -21,13 +22,6 @@
logger = logging.getLogger(__name__)


@dataclass
class ForumUserData:
id: int
slug: str
name: str


@dataclass
class ForumCategoryLastPostData:
posted_time: datetime
Expand Down
10 changes: 9 additions & 1 deletion yellowstone/types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
"""
Contains type definitions for use in annotations.
Contains class and type definitions for use in annotations.
"""

from dataclasses import dataclass
from typing import Union

Json = Union[None, int, float, str, list["Json"], dict[str, "Json"]]


@dataclass
class ForumUserData:
id: int
slug: str
name: str

0 comments on commit 965a23a

Please sign in to comment.