-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodelview.py
141 lines (118 loc) · 4.3 KB
/
modelview.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/user/bin/env python3
# pylint: disable=trailing-whitespace
# ruff: noqa: ANN101, I001, ARG002
# noqa: W291, W293
"""Module: Model & View for the Terminal App."""
class Views:
"""Views.
:property: View.Load
:property: View.Todo
"""
# Views
Overviews: str = "Overviews"
Project: str = "Project"
Criteria: str = "Criteria"
Reference: str = "Reference"
ToDos: str = "ToDo"
#
All: str = "All"
Simple: str = "Simple"
Notes: str = "Notes"
Done: str = "Done"
Grade: str = "Grade"
Review: str = "Review"
ToDo: str = "ToDo"
Load: list[str] = ["Overview", "Project", "Criteria",
"ToDo", "Reference"]
Todo: list[str] = ["All", "Simple", "Notes", "Done",
"Grade", "Review"]
SearchAxes: list[str] = ["index", "row", "column"]
LocateAxis: list[str] = ["index"]
def __init__(self) -> None:
"""Initialize."""
pass
class ColumnSchema:
"""Column Names: simple Dataschema for the Datamodel.
Usage:
To reduce string repetition, as per datamodel, and simplify reuse.
Done by centralising string values into one class/instance, for config.
Future:
Additionally, this class could be (future feature) used to
dynamically generate/CRUD any changed in the Google sheet
without negatively impacting the codebase and raising KeyErrors.
Attributes:
----------
property: Row: str
property: Position: str
property: Tier: str
property: Prefix: str
property: Depth: str
property: DoD: str
property: Performance: str
property: Group: str
property: Topic: str
property: Reference: str
property: Criteria: str
property: Progress: str
property: Flag: str
property: Notes: str
------
"""
# Row: str = "RowID"
Position: str = "Position"
Tier: str = "Tier"
Prefix: str = "TierPrefix"
Depth: str = "TierDepth"
DoD: str = "DoD"
Performance: str = "Performance"
Group: str = "CriteriaGroup"
Topic: str = "CriteriaTopic"
Reference: str = "CriteriaRef"
Criteria: str = "Criteria"
Progress: str = "Progress"
Notes: str = "Notes"
Related: str = "LinkedRef"
class Headers:
"""Headers.
Attributes:
----------
property: Criteria: list[Column]
property: Project: list[Column]
property: MetaData: list[Column]
property: References: list[Column].
Where Column is an Enum of the column names or a subset.
"""
c: ColumnSchema = ColumnSchema()
OverviewViews: list[str] = [c.Position, c.Group, c.Performance,
c.Topic, c.Criteria, c.Progress]
CriteriaView: list[str] = [c.Position, c.Topic,
c.Reference, c.Criteria, c.Notes]
ProjectView: list[str] = [c.Position, c.Tier, c.DoD, c.Reference,
c.Progress]
# ToDoView: Command
ToDoAllView: list[str] = [c.Position, c.Performance, c.DoD, c.Criteria,
c.Progress, c.Notes]
ToDoSimpleView: list[str] = [c.Position, c.Criteria]
ToDoNotesView: list[str] = [c.Position, c.Progress, c.Notes]
ToDoProgressView: list[str] = [c.Position, c.Criteria, c.Progress, c.DoD]
ToDoGradeView: list[str] = [c.Position, c.Criteria,
c.Performance, c.DoD]
ToDoReviewView: list[str] = [c.Reference, c.Criteria,
c.Notes, c.Progress]
#
NotesView: list[str] = [c.Position, c.Criteria, c.Notes]
ReferenceView: list[str] = [c.Position, c.Reference, c.Related]
ViewFilter: list[str] = ["Overview", "Criteria",
"Project", "ToDo", "References"]
ToDoChoices: list[str] = ["All", "Simple", "Notes",
"Progress", "Grade", "Review"]
HeadersChoices: list[str] = ["Position", "Tier", "Performance",
"Criteria", "Progress", "Notes"]
def __init__(self, labels: ColumnSchema) -> None:
"""Headers."""
self.c = labels
# This is the only object to be imported by controller.py
Head: Headers = Headers(labels=ColumnSchema())
# End of Mode/View for the Terminal App.
# Ruff Checked, Pep6CI Checked - Some Passing
# Timestamp: 2022-06-02T18:45, copywrite (c) 2022-2025, Charles J Fowler