This repository has been archived on 2022-01-29. You can view files and clone it, but cannot push or open issues or pull requests.
saturn/src/__main__.py

32 lines
751 B
Python
Raw Normal View History

2022-01-25 18:43:10 +01:00
import argparse
import configparser
import logging
from pathlib import Path
import caldav
parser = argparse.ArgumentParser(description='Web-based CalDav client')
parser.add_argument('-c', '--config', type=Path, default='config.ini',
help='Configuration file path')
args = parser.parse_args()
config = configparser.ConfigParser()
config.read(args.config)
logging.basicConfig(level=config.get('logging', 'level', fallback='WARN'))
log = logging.getLogger('saturn')
log.info('Starting saturn')
cli = caldav.davclient.DAVClient(
config.get('caldav', 'host'),
username=config.get('caldav', 'username', fallback=None),
password=config.get('caldav', 'password', fallback=None),
)
pri = cli.principal()
log.info(pri)