blob: 25fa8bcc469b7f607dea9da8b59472bc28ba557a [file] [log] [blame]
martin f. krafftf37f0682013-06-14 16:36:20 +02001#
2# -*- coding: utf-8 -*-
3#
4# This file is part of reclass (http://github.com/madduck/reclass)
5#
6# Copyright © 2007–13 martin f. krafft <madduck@madduck.net>
7# Released under the terms of the Artistic Licence 2.0
8#
9from output import OutputterBase
10import json
11
12class Outputter(OutputterBase):
13
14 def dump(self, data, pretty_print=False):
15 separators = (',', ': ') if pretty_print else (',', ':')
16 indent = 2 if pretty_print else None
17 return json.dumps(data, indent=indent, separators=separators)