From d99300e5a93e6bec039401640375cfd16fa175f8 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 5 Feb 2015 13:34:52 +0530 Subject: [PATCH] pan.do/ra indiancine.ma overlay --- .gitignore | 2 ++ install.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .gitignore create mode 100755 install.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c9b568f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +*.swp diff --git a/install.py b/install.py new file mode 100755 index 0000000..4aae60e --- /dev/null +++ b/install.py @@ -0,0 +1,58 @@ +#!/usr/bin/python + +import os +from os.path import join, abspath, basename, dirname + +name = 'bakma' +base = abspath(dirname(__file__)) +os.chdir(base) + +for root, folders, files in os.walk(join(base, 'static')): + for f in files: + src = join(root, f) + target = src.replace(base, '/srv/pandora') + rel_src = os.path.relpath(src, dirname(target)) + if os.path.exists(target): + os.unlink(target) + os.symlink(rel_src, target) + +''' +overwrite = ( + ('home', 'indiancinema'), + ('infoView', 'indiancinema'), +) + +os.chdir('/srv/pandora/static/js') +for filename, sitename in overwrite: + src = '%s.%s.js' % (filename, sitename) + target = '%s.%s.js' % (filename, name) + if os.path.exists(target): + os.unlink(target) + os.symlink(src, target) +''' + +os.chdir(base) +src = join(base, 'config.jsonc') +target = '/srv/pandora/pandora/config.%s.jsonc' % name +rel_src = os.path.relpath(src, dirname(target)) +if os.path.exists(target): + os.unlink(target) +os.symlink(rel_src, target) +t = '/srv/pandora/pandora/config.jsonc' +if os.path.exists(t): + os.unlink(t) +os.symlink(basename(target), t) + +for root, folders, files in os.walk(join(base, 'scripts')): + for f in files: + src = join(root, f) + target = src.replace(base, '/srv/pandora') + rel_src = os.path.relpath(src, dirname(target)) + if os.path.exists(target): + os.unlink(target) + os.symlink(rel_src, target) + +#todo +#custom python module etc +#local_settings.py? +