aboutsummaryrefslogtreecommitdiffstats
path: root/config_file/json_parser.py
blob: 5314cd75e454df76a4cbc5dc87e3a2de90b49dcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import json

from .base_parser import BaseParser


class JsonParser(BaseParser):
    def __init__(self, file_contents: str):
        super().__init__(
            file_contents=file_contents,
            module=json,
            decode_error=json.decoder.JSONDecodeError,
        )

    def stringify(self) -> str:
        return json.dumps(self.parsed_content, indent=4)