From 12574c562c6ce7b5193ea8dcbf2865447740573f Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 15 Mar 2012 12:12:03 -0400 Subject: [PATCH] update json-yaml converter to take the directory with json files to process as well as the distro name to extract --- tools/json2yaml.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 tools/json2yaml.py diff --git a/tools/json2yaml.py b/tools/json2yaml.py old mode 100644 new mode 100755 index 2aa09746..ad6f378f --- a/tools/json2yaml.py +++ b/tools/json2yaml.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python import glob import json @@ -15,9 +16,10 @@ def load_json(fn): ) return json.loads(data) -distro = sys.argv[1] +inputdir = sys.argv[1] +distro = sys.argv[2] -for input_file in glob.glob('conf/pkgs/*.json'): +for input_file in glob.glob('%s/*.json' % inputdir): data = load_json(input_file) print