8 data = os.path.join(os.path.dirname(__file__), '..', 'data')
9 deck_dir = os.path.join(data, 'location_decks')
11 for yaml_fn in os.listdir(deck_dir):
12 basename, extension = os.path.splitext(yaml_fn)
13 if extension != '.yaml':
15 json_fn = basename + '.json'
17 yaml_path = os.path.join(deck_dir, yaml_fn)
18 json_path = os.path.join(deck_dir, json_fn)
20 if not update and os.path.exists(json_path):
24 with open(yaml_path) as yaml_f:
25 obj = yaml.safe_load(yaml_f)
26 with open(json_path, 'w') as json_f:
27 json.dump(obj, json_f, indent=2)
30 if __name__ == '__main__':