Add configparser
This commit is contained in:
parent
26bb615553
commit
90a5b9b628
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
*.png
|
*.png
|
||||||
*.ttf
|
*.ttf
|
||||||
|
config.ini
|
||||||
|
|
|
@ -3,6 +3,7 @@ from bottle import route, run, static_file, template
|
||||||
from os import listdir
|
from os import listdir
|
||||||
from os.path import join as pathjoin
|
from os.path import join as pathjoin
|
||||||
from random import random, choice
|
from random import random, choice
|
||||||
|
import configparser
|
||||||
|
|
||||||
# echo -n "["; ls | xargs -I{} echo -n \"{}\",; echo "]"
|
# echo -n "["; ls | xargs -I{} echo -n \"{}\",; echo "]"
|
||||||
BG_IMAGES = listdir("./static/img/background")
|
BG_IMAGES = listdir("./static/img/background")
|
||||||
|
@ -41,4 +42,10 @@ def random_bg_image():
|
||||||
def callback(path):
|
def callback(path):
|
||||||
return static_file(path, root="static")
|
return static_file(path, root="static")
|
||||||
|
|
||||||
|
def parseConfig():
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read("config.ini")
|
||||||
|
return config
|
||||||
|
|
||||||
|
CONFIG = parseConfig()
|
||||||
run(host="localhost", port=8080)
|
run(host="localhost", port=8080)
|
||||||
|
|
Loading…
Reference in a new issue