view localtypes.py @ 83:7f50e5bb30f5

ide
author drewp@bigasterisk.com
date Sat, 07 Sep 2024 16:12:15 -0700
parents 7d9609edcf9c
children f75b3a109b66
line wrap: on
line source

import datetime
from typing import TypedDict


class MongoConf(TypedDict):
    host: str
    port: int
    database: str
    collection: str


class Conf(TypedDict):
    event_uri_ns: str
    minutes_between_polls: float
    mongo: MongoConf


class Record(TypedDict):
    uri: str
    feed: str
    title: str
    start: int
    startTime: datetime.datetime
    startDate: int
    end: int
    endTime: datetime.datetime
    endDate: int
    endTimeUnspecified: bool
    htmlLink: str
    creatorEmail: str


def feedFromCalId(conf: Conf, calId: str) -> str:
    return conf['event_uri_ns'] + 'feed/' + calId