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

37 lines
830 B
Python
Raw Normal View History

2022-01-25 18:43:10 +01:00
import argparse
import configparser
import logging
2022-01-26 15:35:02 +01:00
## dev imports
from pprint import pp
import sys
2022-01-25 18:43:10 +01:00
from pathlib import Path
2022-01-26 15:35:02 +01:00
from datetime import date
2022-01-25 18:43:10 +01:00
import caldav
2022-01-26 16:07:14 +01:00
from .server import app
2022-01-25 18:43:10 +01:00
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')
2022-01-26 16:07:14 +01:00
if __name__ == '__main__':
app.run(
host=config.get('server', 'host', fallback=None),
port=config.get('server', 'port', fallback=None),
debug=config.get('server', 'debug', fallback=None),
)