get id from config file

This commit is contained in:
j 2019-07-18 11:51:31 +02:00
parent c944d4c5e9
commit e1e5912423
2 changed files with 10 additions and 3 deletions

0
__init__.py Normal file
View file

View file

@ -1,10 +1,11 @@
#!/usr/bin/python3 #!/srv/pandora/bin/python3
import os import os
from os.path import join, abspath, basename, dirname from os.path import join, abspath, basename, dirname
# change this import ox
name = 'placeholder'
overwrite = ( overwrite = (
#('home', 'indiancinema'), #('home', 'indiancinema'),
#('infoView', 'indiancinema'), #('infoView', 'indiancinema'),
@ -13,6 +14,12 @@ overwrite = (
base = abspath(dirname(__file__)) base = abspath(dirname(__file__))
os.chdir(base) os.chdir(base)
name = os.path.basename(base)
config = join(base, 'config.jsonc')
if os.path.exists(config):
with open('/srv/pandora/northeast/config.jsonc') as fd:
name = ox.jsonc.load(fd)['site']['id']
for root, folders, files in os.walk(join(base, 'static')): for root, folders, files in os.walk(join(base, 'static')):
for f in files: for f in files:
src = join(root, f) src = join(root, f)