# HG changeset patch # User drewp@bigasterisk.com # Date 1627769123 25200 # Node ID fe334d22286ae9790bac3eb7a5870aaa2e7bb370 # Parent 8122ff3b0fe5f0acacf977457b0c7f011eb0457e button for updating a subset of cals diff -r 8122ff3b0fe5 -r fe334d22286a gcalendarwatch.py --- a/gcalendarwatch.py Sat Jul 31 14:59:25 2021 -0700 +++ b/gcalendarwatch.py Sat Jul 31 15:05:23 2021 -0700 @@ -312,8 +312,10 @@ class PollNow(cyclone.web.RequestHandler): def post(self): - cal = json.loads(self.request.body).get('cal', None) if self.request.body else None - n = self.settings.poller.updateNow(cal) + cals = json.loads(self.request.body).get('cals', None) if self.request.body else None + n = 0 + for cal in cals: + n += self.settings.poller.updateNow(cal) msg = f"found {n} new records" log.info(msg) self.write(msg.encode('utf8')) diff -r 8122ff3b0fe5 -r fe334d22286a index.html --- a/index.html Sat Jul 31 14:59:25 2021 -0700 +++ b/index.html Sat Jul 31 15:05:23 2021 -0700 @@ -11,7 +11,7 @@
MSG
- +@@ -28,7 +28,12 @@ }, poll1Now: function() { document.querySelector("#results").innerText += "poll...\n" - $.post("pollNow", JSON.stringify({cal: "iem9ppgqdbleh96nkeaj4l6714@group.calendar.google.com"}), + $.post("pollNow", JSON.stringify({ + cals: [ + "iem9ppgqdbleh96nkeaj4l6714@group.calendar.google.com", + "i08lv6mki8a23lloc139il5oh8@group.calendar.google.com", + ] + }), function (res) { document.querySelector("#results").innerText += res + "\ndone.\n" });