home · contact · privacy
Add minimalist plain-text calendar view.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 6 Jun 2024 06:20:22 +0000 (08:20 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 6 Jun 2024 06:20:22 +0000 (08:20 +0200)
.pylintrc
plomtask/http.py
templates/calendar.html

index 82e4d962179f10cfda7a1744d97ed91d8f268686..b4814d17d477dee4ee5ba2f67f52a04c41ba7b5d 100644 (file)
--- a/.pylintrc
+++ b/.pylintrc
@@ -1,3 +1,3 @@
 [BASIC]
 init-hook='import sys; sys.path.append(".")'
-good-names-rgxs=(test_)?do_(GET|POST)(_[a-z]+)?,test_[A-Z]+
+good-names-rgxs=.*_?do_(GET|POST)(_[a-z]+)?,test_[A-Z]+
index 1a06f3094c9c66a95f73b9a13e52d7618d3b2aaa..bb05fa9618effaf7279ffe8553f872d3d1f16e05 100644 (file)
@@ -110,7 +110,7 @@ class TaskHandler(BaseHTTPRequestHandler):
         finally:
             self.conn.close()
 
-    def do_GET_calendar(self) -> dict[str, object]:
+    def _do_GET_calendar(self) -> dict[str, object]:
         """Show Days from ?start= to ?end=."""
         start = self.params.get_str('start')
         end = self.params.get_str('end')
@@ -124,6 +124,14 @@ class TaskHandler(BaseHTTPRequestHandler):
         today = date_in_n_days(0)
         return {'start': start, 'end': end, 'days': days, 'today': today}
 
+    def do_GET_calendar(self) -> dict[str, object]:
+        """Show Days from ?start= to ?end= – normal view."""
+        return self._do_GET_calendar()
+
+    def do_GET_calendar_txt(self) -> dict[str, object]:
+        """Show Days from ?start= to ?end= – minimalist view."""
+        return self._do_GET_calendar()
+
     def do_GET_day(self) -> dict[str, object]:
         """Show single Day of ?date=."""
         date = self.params.get_str('date', date_in_n_days(0))
index 42c821ae7a31de4bce3161e945cb3ec0b7919609..699caabdd05b687a262be37ea32ac1da7ca3c1bc 100644 (file)
@@ -35,6 +35,8 @@ td.today {
 {% block content %}
 <h3>calendar</h3>
 
+<p><a href="/calendar_txt">basic view</a></p>
+
 <form action="calendar" method="GET">
 from <input name="start" value="{{start}}" />
 to <input name="end" value="{{end}}" />