• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2
3import os
4import sys
5
6import yaml
7
8
9# Need to import modules that lie on an upward-relative path
10sys.path.append(os.path.join(sys.path[0], ".."))
11
12import cimodel.lib.miniyaml as miniyaml
13
14
15def regurgitate(depth, use_pyyaml_formatter=False):
16    data = yaml.safe_load(sys.stdin)
17
18    if use_pyyaml_formatter:
19        output = yaml.dump(data, sort_keys=True)
20        sys.stdout.write(output)
21    else:
22        miniyaml.render(sys.stdout, data, depth)
23
24
25if __name__ == "__main__":
26    regurgitate(3)
27