icalfilter: do some work to make it work again

This commit is contained in:
Luke Granger-Brown 2023-06-18 20:32:25 +01:00
parent 364eaa2c55
commit c46298132e
3 changed files with 10 additions and 11 deletions

View file

@ -114,6 +114,8 @@ async def all_occurrences_before(
) -> bool: ) -> bool:
parsed_event = icalevents.icalparser.create_event(event, cutoff.tzinfo) parsed_event = icalevents.icalparser.create_event(event, cutoff.tzinfo)
if not parsed_event.recurring: if not parsed_event.recurring:
if type(parsed_event.end) is datetime.date:
return parsed_event.end < cutoff.date()
return parsed_event.end < cutoff return parsed_event.end < cutoff
loop = asyncio.get_running_loop() loop = asyncio.get_running_loop()
@ -127,11 +129,12 @@ async def keep_event(
event: icalendar.Event, event: icalendar.Event,
seen_timezones: Dict[str, icalendar.Timezone], seen_timezones: Dict[str, icalendar.Timezone],
) -> bool: ) -> bool:
summary = event.get('summary', '')
if source_cal.keep_hashtags: 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 return False
if source_cal.drop_hashtags: 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 return False
if source_cal.skip_before: if source_cal.skip_before:
if "dtstart" not in event: if "dtstart" not in event:

View file

@ -25,16 +25,12 @@ let
icalevents = ps: ps.buildPythonPackage rec { icalevents = ps: ps.buildPythonPackage rec {
pname = "icalevents"; pname = "icalevents";
version = "0.1.26"; version = "0.1.27";
format = "pyproject"; format = "pyproject";
prePatch = '' nativeBuildInputs = with ps; [ poetry-core pythonRelaxDepsHook ];
substituteInPlace pyproject.toml \
--replace 'pytz = "==2021.3"' 'pytz = "*"' \
--replace '= "==' '= "^'
'';
nativeBuildInputs = with ps; [ poetry-core ]; pythonRelaxDeps = true;
propagatedBuildInputs = with ps; [ propagatedBuildInputs = with ps; [
httplib2 httplib2
@ -48,7 +44,7 @@ let
owner = "jazzband"; owner = "jazzband";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
hash = "sha256:06mq3nzn7vipmb1jvw3c05cw3k3bgvkgs02xqzry94pjvbn0nmiz"; hash = "sha256:191j9ki8y5gg9g34ilx6yv5vghxm1gch413cw42pb3a1j48109mx";
}; };
}; };

View file

@ -8,7 +8,7 @@ let
!package.json !package.json
!package-lock.json !package-lock.json
'' ./.; '' ./.;
nodeComposition = import ./node-composition.nix { inherit pkgs; }; nodeComposition = import ./node-composition.nix { inherit pkgs; nodejs = pkgs."nodejs_20"; };
in in
pkgs.runCommand "icalfilter-webui" { pkgs.runCommand "icalfilter-webui" {
inherit src; inherit src;