-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathmodels.py
56 lines (46 loc) · 1.67 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! python3 # noqa: E265
# ############################################################################
# ########## Libraries #############
# ##################################
# standard
from dataclasses import dataclass, field
from datetime import datetime
from pathlib import Path
from typing import Optional
# package modules
from mkdocs_rss_plugin.__about__ import __title__, __version__
# ############################################################################
# ########## Classes ###############
# ##################################
@dataclass
class PageInformation:
"""Object describing a page information gathered from Mkdocs and used as feed's item."""
abs_path: Optional[Path] = None
categories: Optional[list] = None
authors: Optional[tuple] = None
created: Optional[datetime] = None
description: Optional[str] = None
guid: Optional[str] = None
image: Optional[str] = None
title: Optional[str] = None
updated: Optional[datetime] = None
url_comments: Optional[str] = None
url_full: Optional[str] = None
@dataclass
class RssFeedBase:
"""Object describing a feed."""
author: Optional[str] = None
buildDate: Optional[str] = None
copyright: Optional[str] = None
description: Optional[str] = None
entries: list[PageInformation] = field(default_factory=list)
generator: str = f"{__title__} - v{__version__}"
html_url: Optional[str] = None
json_url: Optional[str] = None
language: Optional[str] = None
logo_url: Optional[str] = None
pubDate: Optional[str] = None
repo_url: Optional[str] = None
rss_url: Optional[str] = None
title: Optional[str] = None
ttl: Optional[int] = None