-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdataFormat.py
65 lines (56 loc) · 1.39 KB
/
dataFormat.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
57
58
59
60
61
62
63
64
65
from dataclasses import dataclass
from typing import ClassVar
@dataclass
class SVG():
file:str
@dataclass
class DisplayItem:
"""An itsm representing a piece of information to be displayed on the page."""
size:ClassVar[float]
TYPE:ClassVar[str]
def getSize(self)->float:
return self.size
# e.g. "Exams", "Modules", "Courseworks", "Deadlines" etc.
@dataclass
class Category:
"""A group of information collected under a header and icon."""
name:str
image:SVG
items:list[DisplayItem]
@dataclass
class User:
"""A user's information containing all the information to display on the page."""
name:str
degree:str
year_of_study:str
info:list[Category]
@dataclass
class ThreePart(DisplayItem):
"""A three part data structure. e.g. 'You have submitted" "35" "assignments' """
first:str
second:str
third:str
size=1
TYPE="ThreePart"
@dataclass
class FivePart(DisplayItem):
"""a five part data structure. e.g. 'Your Highest module was Databases with a total of 86 %'"""
first:str
second:str
third:str
fourth:str
fith:str
size=1.3
TYPE="FivePart"
@dataclass
class Image(DisplayItem):
"""Class for generic images usiually charts"""
url:str
size=2.5
TYPE="Image"
@dataclass
class Page(DisplayItem):
"""Used for templating do not use"""
info:list[Category]
size=1
TYPE="Page"