py39 compatibility
This commit is contained in:
parent
d4d266e7c5
commit
0ce96c608e
1 changed files with 3 additions and 2 deletions
|
@ -13,6 +13,7 @@ import sys
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from subprocess import check_output
|
from subprocess import check_output
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
import pytz
|
import pytz
|
||||||
from icalendar import Calendar, Event
|
from icalendar import Calendar, Event
|
||||||
|
@ -79,7 +80,7 @@ class IcsNow:
|
||||||
return []
|
return []
|
||||||
return Calendar.from_ical(result, multiple=True)
|
return Calendar.from_ical(result, multiple=True)
|
||||||
|
|
||||||
def pick_most_important(self, events: list[Event]) -> Event | None:
|
def pick_most_important(self, events: list[Event]) -> Optional[Event]:
|
||||||
if not events:
|
if not events:
|
||||||
return None
|
return None
|
||||||
# FIXME: sort by priority
|
# FIXME: sort by priority
|
||||||
|
@ -115,7 +116,7 @@ class IcsNow:
|
||||||
json.dump(ret, sys.stdout, indent=2)
|
json.dump(ret, sys.stdout, indent=2)
|
||||||
sys.stdout.write("\n")
|
sys.stdout.write("\n")
|
||||||
|
|
||||||
def serialize(self, event: Event | None):
|
def serialize(self, event: Optional[Event]):
|
||||||
if event is None:
|
if event is None:
|
||||||
return None
|
return None
|
||||||
out = {
|
out = {
|
||||||
|
|
Loading…
Reference in a new issue