summaryrefslogtreecommitdiff
path: root/overlays
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2024-08-01 10:31:11 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2024-08-01 10:31:11 +0200
commit48f8d3c11d9117f10e6ca5b76a08b91cef5c861b (patch)
tree1c0aed455c6cd4d73a390463e0ed40582fc481c4 /overlays
parent3c203b2eb88055d4e8a6cffecf257b9f1a2009d9 (diff)
downloadnixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.tar
nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.tar.gz
nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.tar.bz2
nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.tar.xz
nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.zip
...
Diffstat (limited to 'overlays')
-rw-r--r--overlays/radicale.nix13
-rwxr-xr-xoverlays/worktime/worktime/__main__.py4
2 files changed, 15 insertions, 2 deletions
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 @@
1{ prev, ... }:
2let
3 nixpkgs = prev.fetchFromGitHub {
4 owner = "NixOS";
5 repo = "nixpkgs";
6 rev = "5fa4d405272ea98dab145f0c9f7ea1dbb9c87c31";
7 hash = "sha256-Qwwbt4vbqwllUJElZomSybbZkbmhsuIac3gqrl+GVUs=";
8 };
9 pkgs = (import (nixpkgs + "/pkgs/top-level")) { localSystem = prev.stdenv.buildPlatform.system; };
10in rec {
11 radicale3 = radicale;
12 inherit (pkgs) radicale;
13}
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):
42 REPORTS = '/reports/api/v2' 42 REPORTS = '/reports/api/v2'
43 43
44class TogglAPIError(Exception): 44class TogglAPIError(Exception):
45 def __init__(self, http_error, response): 45 def __init__(self, response, *, http_error=None):
46 self.http_error = http_error 46 self.http_error = http_error
47 self.response = response 47 self.response = response
48 48
@@ -179,7 +179,7 @@ class TogglAPI(object):
179 url = self._make_url(api = TogglAPISection.TOGGL, section = ['me', 'time_entries', 'current']) 179 url = self._make_url(api = TogglAPISection.TOGGL, section = ['me', 'time_entries', 'current'])
180 r = self._query(url = url, method='GET') 180 r = self._query(url = url, method='GET')
181 181
182 if not r or not r.json(): 182 if not r or (not r.json() and r.json() is not None):
183 raise TogglAPIError(r) 183 raise TogglAPIError(r)
184 184
185 if not r.json() or not r.json()['billable']: 185 if not r.json() or not r.json()['billable']: