From e1e59124235da45b93ffcfb5f4fbce82e5e40cde Mon Sep 17 00:00:00 2001 From: j Date: Thu, 18 Jul 2019 11:51:31 +0200 Subject: [PATCH] get id from config file --- __init__.py | 0 install.py | 13 ++++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/install.py b/install.py index 53257ac..b889a9d 100755 --- a/install.py +++ b/install.py @@ -1,10 +1,11 @@ -#!/usr/bin/python3 +#!/srv/pandora/bin/python3 import os from os.path import join, abspath, basename, dirname -# change this -name = 'placeholder' +import ox + + overwrite = ( #('home', 'indiancinema'), #('infoView', 'indiancinema'), @@ -13,6 +14,12 @@ overwrite = ( base = abspath(dirname(__file__)) 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 f in files: src = join(root, f)