summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2012-10-17 19:43:46 +0200
committerChristian Pointner <equinox@spreadspace.org>2012-10-17 19:43:46 +0200
commitcd8847ccfe8099e0c4d02a3f9a17232497787671 (patch)
tree1278d7328bc0dd9e54605ae806821951b34114db
parentadded audomatic repeater generation (diff)
moved template parameter to config file
-rw-r--r--src/audio.json1
-rwxr-xr-xsrc/flufigut.py9
-rw-r--r--src/test.json1
-rw-r--r--src/test2.json1
4 files changed, 10 insertions, 2 deletions
diff --git a/src/audio.json b/src/audio.json
index d8bc0d9..435a5d9 100644
--- a/src/audio.json
+++ b/src/audio.json
@@ -1,5 +1,6 @@
{
"globals":{
+ "templates": "example",
"version": "0.10.0",
"name": "audio-only",
"description": "Audio only test",
diff --git a/src/flufigut.py b/src/flufigut.py
index 2f3b2c2..d2ef659 100755
--- a/src/flufigut.py
+++ b/src/flufigut.py
@@ -47,7 +47,12 @@ def rand_string(size=8, chars=string.ascii_lowercase + string.ascii_uppercase +
### parse json file #############################################
#
if len(sys.argv) <= 2:
- raise SystemExit("ERROR: No template name and or configuration file given")
+ raise SystemExit("ERROR: No output format and or configuration file given")
+
+output_format = sys.argv[1]
+
+if output_format != 'flumotion':
+ raise SystemExit("OUTPUT FORMAT: currently only flumotion configuration files can be generated")
cf = open(sys.argv[2], 'r')
config = json.load(cf);
@@ -365,7 +370,7 @@ if error != 0:
import shutil
shutil.rmtree('output', ignore_errors=True)
-env = Environment(loader=FileSystemLoader('../templates/%s/' % (sys.argv[1])), line_statement_prefix = '%%')
+env = Environment(loader=FileSystemLoader('../templates/%s/' % (globals['templates'])), line_statement_prefix = '%%')
print "generating planet '%s/%s'" % (globals['manager']['machine'], globals['name'])
template = env.get_template('planet.xml')
diff --git a/src/test.json b/src/test.json
index 3925c6a..56188fa 100644
--- a/src/test.json
+++ b/src/test.json
@@ -1,5 +1,6 @@
{
"globals":{
+ "templates": "example",
"version": "0.10.0",
"name": "elevate-live",
"description": "Live from Elevate Festival 2012",
diff --git a/src/test2.json b/src/test2.json
index 1069187..7b66060 100644
--- a/src/test2.json
+++ b/src/test2.json
@@ -1,5 +1,6 @@
{
"globals":{
+ "templates": "example",
"version": "0.10.0",
"name": "elevate-live",
"description": "Live from Elevate Festival 2012",