File: helpers.py

package info (click to toggle)
python-baron 0.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,080 kB
  • sloc: python: 26,926; makefile: 126; sh: 27
file content (17 lines) | stat: -rw-r--r-- 408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import json
import sys
from os import linesep
from . import parse


def show(source_code):
    sys.stdout.write(json.dumps(parse(source_code), indent=4) + linesep)


def show_file(target_file):
    with open(target_file, "r") as source_code:
        sys.stdout.write(json.dumps(parse(source_code.read()), indent=4) + linesep)


def show_node(node):
    sys.stdout.write(json.dumps(node, indent=4) + linesep)