diff --git a/main.py b/main.py index 39a2daf..432ed2d 100755 --- a/main.py +++ b/main.py @@ -5,7 +5,7 @@ from caldav import DAVClient, Calendar, Principal, Todo import configparser -def parseConfig(): +def parseConfig() -> tuple[str, str, str, str]: def passwordFromFile() -> str: calDavPasswordFile = config.get("calDAV", "passwordFile") with open(calDavPasswordFile, "r") as file: @@ -13,8 +13,8 @@ def parseConfig(): config = configparser.ConfigParser() config.read("/etc/calDAVtoCSV/config.ini") + calDavAddress = config.get("calDAV", "address") - print(calDavAddress) calDavUsername = config.get("calDAV", "username") caldavpwd = config.get("calDAV", "password", fallback=None) caldavpwd = caldavpwd if caldavpwd is not None else passwordFromFile() @@ -50,10 +50,6 @@ def fetch_10_next_todos_as_csv() -> str: return csv -def put(todos, uid): - item = filter(lambda todo: todo.icalendar_component["uid"] == uid, todos) - - app = Flask(__name__) @@ -62,5 +58,6 @@ def send_events(): return fetch_10_next_todos_as_csv() +# not suitable for production apparently, just for testing if __name__ == "__main__": app.run(host="0.0.0.0", port=8000)