23 lines
475 B
Python
23 lines
475 B
Python
import logging
|
|
|
|
import flask
|
|
|
|
from autopilot.ical import generate_ical
|
|
from autopilot.scrape import get_reservations
|
|
from autopilot.config import LOGGING_CONFIG
|
|
|
|
|
|
logging.config.dictConfig(LOGGING_CONFIG)
|
|
app = flask.Flask(__name__)
|
|
|
|
|
|
@app.route('/schedule.ics')
|
|
def main():
|
|
reservations = get_reservations()
|
|
ical = generate_ical(reservations)
|
|
return flask.Response(ical.serialize(), mimetype="text/calendar")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run(debug=True)
|