From 48f8d3c11d9117f10e6ca5b76a08b91cef5c861b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 1 Aug 2024 10:31:11 +0200 Subject: ... --- overlays/radicale.nix | 13 +++++++++++++ overlays/worktime/worktime/__main__.py | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 overlays/radicale.nix (limited to 'overlays') diff --git a/overlays/radicale.nix b/overlays/radicale.nix new file mode 100644 index 00000000..a4179295 --- /dev/null +++ b/overlays/radicale.nix @@ -0,0 +1,13 @@ +{ prev, ... }: +let + nixpkgs = prev.fetchFromGitHub { + owner = "NixOS"; + repo = "nixpkgs"; + rev = "5fa4d405272ea98dab145f0c9f7ea1dbb9c87c31"; + hash = "sha256-Qwwbt4vbqwllUJElZomSybbZkbmhsuIac3gqrl+GVUs="; + }; + pkgs = (import (nixpkgs + "/pkgs/top-level")) { localSystem = prev.stdenv.buildPlatform.system; }; +in rec { + radicale3 = radicale; + inherit (pkgs) radicale; +} diff --git a/overlays/worktime/worktime/__main__.py b/overlays/worktime/worktime/__main__.py index 5630837b..0df226fa 100755 --- a/overlays/worktime/worktime/__main__.py +++ b/overlays/worktime/worktime/__main__.py @@ -42,7 +42,7 @@ class TogglAPISection(Enum): REPORTS = '/reports/api/v2' class TogglAPIError(Exception): - def __init__(self, http_error, response): + def __init__(self, response, *, http_error=None): self.http_error = http_error self.response = response @@ -179,7 +179,7 @@ class TogglAPI(object): url = self._make_url(api = TogglAPISection.TOGGL, section = ['me', 'time_entries', 'current']) r = self._query(url = url, method='GET') - if not r or not r.json(): + if not r or (not r.json() and r.json() is not None): raise TogglAPIError(r) if not r.json() or not r.json()['billable']: -- cgit v1.2.3