From c46298132edf17319d3caeacd3f792e4396f0f6c Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 18 Jun 2023 20:32:25 +0100 Subject: [PATCH] icalfilter: do some work to make it work again --- py/icalfilter/app.py | 7 +++++-- py/icalfilter/default.nix | 12 ++++-------- py/icalfilter/web/default.nix | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/py/icalfilter/app.py b/py/icalfilter/app.py index a432409ba8..38be72dadf 100644 --- a/py/icalfilter/app.py +++ b/py/icalfilter/app.py @@ -114,6 +114,8 @@ async def all_occurrences_before( ) -> bool: parsed_event = icalevents.icalparser.create_event(event, cutoff.tzinfo) if not parsed_event.recurring: + if type(parsed_event.end) is datetime.date: + return parsed_event.end < cutoff.date() return parsed_event.end < cutoff loop = asyncio.get_running_loop() @@ -127,11 +129,12 @@ async def keep_event( event: icalendar.Event, seen_timezones: Dict[str, icalendar.Timezone], ) -> bool: + summary = event.get('summary', '') if source_cal.keep_hashtags: - if not contains_any_hashtag(event["summary"], source_cal.keep_hashtags): + if not contains_any_hashtag(summary, source_cal.keep_hashtags): return False if source_cal.drop_hashtags: - if contains_any_hashtag(event["summary"], source_cal.drop_hashtags): + if contains_any_hashtag(summary, source_cal.drop_hashtags): return False if source_cal.skip_before: if "dtstart" not in event: diff --git a/py/icalfilter/default.nix b/py/icalfilter/default.nix index b65f41c097..038845e983 100644 --- a/py/icalfilter/default.nix +++ b/py/icalfilter/default.nix @@ -25,16 +25,12 @@ let icalevents = ps: ps.buildPythonPackage rec { pname = "icalevents"; - version = "0.1.26"; + version = "0.1.27"; format = "pyproject"; - prePatch = '' - substituteInPlace pyproject.toml \ - --replace 'pytz = "==2021.3"' 'pytz = "*"' \ - --replace '= "==' '= "^' - ''; + nativeBuildInputs = with ps; [ poetry-core pythonRelaxDepsHook ]; - nativeBuildInputs = with ps; [ poetry-core ]; + pythonRelaxDeps = true; propagatedBuildInputs = with ps; [ httplib2 @@ -48,7 +44,7 @@ let owner = "jazzband"; repo = pname; rev = "v${version}"; - hash = "sha256:06mq3nzn7vipmb1jvw3c05cw3k3bgvkgs02xqzry94pjvbn0nmiz"; + hash = "sha256:191j9ki8y5gg9g34ilx6yv5vghxm1gch413cw42pb3a1j48109mx"; }; }; diff --git a/py/icalfilter/web/default.nix b/py/icalfilter/web/default.nix index e9337491c1..b90d6290c2 100644 --- a/py/icalfilter/web/default.nix +++ b/py/icalfilter/web/default.nix @@ -8,7 +8,7 @@ let !package.json !package-lock.json '' ./.; - nodeComposition = import ./node-composition.nix { inherit pkgs; }; + nodeComposition = import ./node-composition.nix { inherit pkgs; nodejs = pkgs."nodejs_20"; }; in pkgs.runCommand "icalfilter-webui" { inherit src;