Compare commits

..

No commits in common. "2775b78f8f0709f247cc474f7031e971db9ebb60" and "006145dbf6aeba9dc89b41d8a2dd4d758ebb78e7" have entirely different histories.

2 changed files with 45 additions and 39 deletions

View file

@ -1,37 +0,0 @@
import argparse
import configparser
import logging
import locale
from pathlib import Path
from datetime import date
import caldav
from .server import create_app
from .calendar import get_davclient
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.RawConfigParser()
config.read(args.config)
locale.setlocale(locale.LC_ALL, config.get('locale', 'locale', fallback=None))
logging.basicConfig(level=config.get('logging', 'level', fallback='WARN'))
log = logging.getLogger('saturn')
log.info('Starting saturn')
davclient = get_davclient(config['caldav'])
app = create_app(
bytes(config.get('server', 'secret_key'), 'utf-8'),
config.get('server', 'password'),
davclient,
)

View file

@ -1,4 +1,47 @@
from . import app import argparse
import configparser
import logging
import locale
## dev imports
from pprint import pp
import sys
from pathlib import Path
from datetime import date
import caldav
from .server import create_app
from .calendar import get_davclient
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)
locale.setlocale(locale.LC_ALL, config.get('locale', 'locale', fallback=None))
logging.basicConfig(level=config.get('logging', 'level', fallback='WARN'))
log = logging.getLogger('saturn')
log.info('Starting saturn')
davclient = get_davclient(config['caldav'])
app = create_app(
bytes(config.get('server', 'secret_key'), 'utf-8'),
config.get('server', 'password'),
davclient,
)
if __name__ == '__main__': if __name__ == '__main__':
app.run() app.run(
host=config.get('server', 'host', fallback=None),
port=config.get('server', 'port', fallback=None),
debug=config.get('server', 'debug', fallback=None),
)