Pi66

git.pi66.xyz
A web interface for the pi66.xyz Git server
git clone https://git.pi66.xyz/git.pi66.xyz

src/plugins/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
from dataclasses import dataclass


@dataclass
class ChangedFile:
    name: str
    added_lines: int
    removed_lines: int
    status: str = "M"


@dataclass
class Commit:
    date: str
    message: str
    author: str
    commit_hash: str
    files: list[ChangedFile]
    patch: str


@dataclass
class FileEntry:
    path: str
    mode: str
    size: str


@dataclass
class RefEntry:
    name: str
    date: str
    author: str


@dataclass
class Ref:
    name: str
    refs: list[RefEntry]


@dataclass
class Repo:
    name: str
    desc: str
    author: str
    readme: str | None
    license: str | None
    commits: list[Commit]
    files: list[FileEntry]
    refs: list[Ref]
    last_commit_date: str