diff --git a/.gitignore b/.gitignore index e56c987..c6186a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.png *.ttf +config.ini diff --git a/homepage/main.py b/homepage/main.py index 814131e..d539434 100644 --- a/homepage/main.py +++ b/homepage/main.py @@ -3,6 +3,7 @@ from bottle import route, run, static_file, template from os import listdir from os.path import join as pathjoin from random import random, choice +import configparser # echo -n "["; ls | xargs -I{} echo -n \"{}\",; echo "]" BG_IMAGES = listdir("./static/img/background") @@ -41,4 +42,10 @@ def random_bg_image(): def callback(path): return static_file(path, root="static") +def parseConfig(): + config = configparser.ConfigParser() + config.read("config.ini") + return config + +CONFIG = parseConfig() run(host="localhost", port=8080)