Skip to content

Commit 039ba1f

Browse files
committed
Fixing the reporting applet.
Apparently I made the period,delta update without checking the statblock. It at least posts correctly now.
1 parent fff5bab commit 039ba1f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/thymed/tui.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,12 @@ class Statblock(Container):
204204
delta: reactive[timedelta | None] = reactive(timedelta(days=7), recompose=True)
205205

206206
def compose(self) -> ComposeResult:
207-
# end = datetime.today()
208-
# start = end - self.period
209-
# self.data = self.timecard.general_report(start, end)
207+
end = datetime.today()
208+
start = end - self.delta
209+
try:
210+
self.data = self.timecard.general_report(start, end)
211+
except AttributeError:
212+
self.data = "Data and Statistics"
210213
yield Static(f"Period = {self.period}")
211214
yield Static(f"Days = {self.delta.days}")
212215

@@ -325,7 +328,7 @@ def compose(self) -> ComposeResult:
325328
PlotextPlot(),
326329
self.codes,
327330
# Placeholder(self.name),
328-
Statblock(TimeCard(self.code)),
331+
Statblock(),
329332
Container(
330333
# Title("Period"), Rule(),
331334
Button("Period", id="period"),

0 commit comments

Comments
 (0)