10 data = os.path.join(os.path.dirname(__file__), '..', 'data')
11 deck_dir = os.path.join(data, 'location_decks')
13 for yaml_fn in os.listdir(deck_dir):
14 basename, extension = os.path.splitext(yaml_fn)
15 if extension != '.yaml':
17 json_fn = basename + '.json'
19 yaml_path = os.path.join(deck_dir, yaml_fn)
20 json_path = os.path.join(deck_dir, json_fn)
22 with open(yaml_path) as yaml_f:
23 obj = yaml.safe_load(yaml_f)
24 with open(json_path, 'w') as json_f:
25 json.dump(obj, json_f, indent=2)
28 if __name__ == '__main__':